<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var words = $("p:first").text().split(" ");
var text = words.join("</div> <div>");
$("p:first").html("<div>" + text + "</div>");
$("div").click(function () {
$(this).css("background-color","yellow");
});
});
</script>
</head>
<body>
<body>
<p>a b c</p>
</body>
</html>
|