<html>
<head>
<title></title>
<head>
<script type="text/javascript" src="jquery1.8.3-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
// get and set using jquery
$(document).ready(function () {
$("#jq1").html("Div is Fill.");
var title = $('#jq1').html();
alert(title);
// get and set using javascript
// Get the text content:
alert(document.getElementById("je1").textContent);
// Set the text content:
document.getElementById("je1").textContent = "This is text";
});
</script>
</head>
<body>
<div id="jq1">
jQuery DIV
</div>
<div id="je1">
JavaScript DIV
</div>
</body>
</html>
No comments:
Post a Comment