Monday, March 13, 2017

split test

split test test
<div id="sns20170313m0930" style="font-size:1.5em;color:burlywood"></div>
<a id="sns20170313m0930a" style="color:pink;font-size:1.5em" href="javascript:sns20170313m0930()">split test</a> <span id="sns20170313m0930t" style="color:violet;font-size:1.5em">test</span>

<script>
function sns20170313m0930() {
var c = document.getElementById("sns20170313m0930")
var t = document.getElementById("sns20170313m0930t")
var ta = t.innerHTML.split(" ")
c.innerHTML = ta[0] + " " + ta.length}
</script>

No comments:

Post a Comment