Wednesday, October 12, 2011

jQuery exercise: change text

Exercise to change text using jQuery.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p id="mytext1">Original Text</p>
<p id="mytext2">Original Text</p>
<p id="mytext3">Original Text</p>
<script>
var str = "Text <b>changed</b>";
$("#mytext2").html(str);
</script>

</body>
</html>


jQuery exercise: change text



No comments:

Post a Comment