Friday, May 10, 2013

Web page with {strong} elements with jQuery

selector with the jQuery html() and text() functions to
change the HTML code or text in all matching elements on a page. follow these steps to change the text in all the <strong> elements on a page:


<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html>
<head>
<title>My Test Page</title>
<script type=”text/javascript” src=”js/jquery-1.4.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
var strongContent = ‘jQuery for Dummies’;
});
</script>
</head>
<body>
<strong>some name</strong><p>Some text<p>
<strong>another name</strong>
<p>More text<p>
<strong>another name</strong>
<p>Even more text<p>
<strong>your name</strong>
<p>Last bit of text<p>
</body>
</html>

0 comments:

Post a Comment