How could I achieve the following:
document.regTitle.innerHTML = 'hello';
How could I achieve the following:
document.regTitle.innerHTML = 'hello';
You should add this
$(function(){
$('button').click(function(){
$('span.regTitle').text('Span Text Replaced');
});
});
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span class="regTitle">Sample Content</span>
<br/><br/>
<button>Replace Span</button>
$(function(){
$('#regTitle').html('this is a test');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div id="regTitle"></div>
Here's a snippet for jQuery innerhtml.