In order to set value/text or html to span element using JQuery/Javascript, using the following code<span id="mySpan"></span> using JQuery:$("#mySpan").text("setting span text using juery"); // setting text $("#mySpan").html("<h3>setting span html using</h3> <b>juery</b>"); // setting html using Javascript:var spanEle =document.getElementById('mySpan'); spanEle.innerText = "setting span text using Javascript"; //setting text
spanEle.innerTHTML = "<h3>setting span html using</h3> <b>javascript</b>"; // setting html
|