Asked 30+ days ago
10 Feb 2017
Views 316
pratik

pratik posted

How to replace innerHTML of a div using jQuery?

How to replace innerHTML of a div using jQuery?
Mitul Dabhi

Mitul Dabhi
answered Jan 21 '18 20:17

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
Edit Answer
Share
kiran

kiran
answered Jan 21 '18 20:17


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

})
</script>
Edit Answer
Share
Post Answer