diff options
Diffstat (limited to 'jquery-css-addclass.xhtml')
-rw-r--r-- | jquery-css-addclass.xhtml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/jquery-css-addclass.xhtml b/jquery-css-addclass.xhtml new file mode 100644 index 0000000..e92bd91 --- /dev/null +++ b/jquery-css-addclass.xhtml @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>append css class to a selector</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<style type="text/css"> + .p_background { + background-color: cyan; + } +</style> +<script type="text/javascript" src="jquery-2.0.2.js"></script> +<script type="text/javascript"> + <![CDATA[ + $("document").ready(function() { + $("p:last").addClass("p_background"); + }); + ]]> +</script> +</head> +<body> +<p id="pmain">goodbye, world!</p> +</body> +</html> + |