How to Read and Write Span Elements ?

dhirenkaunar-15094
Posted by dhirenkaunar-15094 under JavaScript category on | Points: 40 | Views : 1121
function updateSpanWithValue(value){
var SPAN = document.getElementById('span_1');
alert(SPAN.Value); // Will Print "Span Demo"
//Update the span tag value.
SPAN.innerHTML = value;
}


in Html Body ..
<span id="span_1"> Span Demo </span>

Comments or Responses

Login to post response