Basic code to change the text using JQuery

Amatya
Posted by Amatya under jQuery category on | Points: 40 | Views : 260
Basic code to change the text using JQuery

 <!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
</head>
<body>
<div id="dnf">Hello</div>
</body>
</html>


The JavaScript:
$(function() {
$("#dnf").html("Hello DNF Friends");
});



This will change the HTML of the element with id="Hello " to "Hello DNF Friends ".

Thanks

Comments or Responses

Login to post response