We would like to know how to change content of "span".
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!-- ww w . j a v a2 s.c o m-->
var ele = document.querySelector(".classid");
ele.innerHTML = ele.innerHTML.trim();
ele.innerHTML = ele.innerHTML.slice(0, -3);
}
</script>
</head>
<body>
<div id="divid">
<span class="classid"> CHANGE IT </span>
</div>
</body>
</html>
The code above is rendered as follows: