Asked 7 years ago
10 Feb 2017
Views 1379
pratik

pratik posted

How to replace innerHTML of a div using jQuery?

How to replace innerHTML of a div using jQuery?
kiran

kiran
answered Nov 30 '-1 00:00


<script type="text/javascript">
$(document).ready(function(){
 $("#firstime").html("put here html to place");

})
</script>
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

html part

<div id="firstime">
i am here 
</div>


jQuery code


<script    src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert($("#firstime").html());

})
</script>


it give you alert of html of given element's id
Post Answer