summaryrefslogtreecommitdiffstats
path: root/jquery-text-n-html-funcs.xhtml
diff options
context:
space:
mode:
Diffstat (limited to 'jquery-text-n-html-funcs.xhtml')
-rw-r--r--jquery-text-n-html-funcs.xhtml38
1 files changed, 38 insertions, 0 deletions
diff --git a/jquery-text-n-html-funcs.xhtml b/jquery-text-n-html-funcs.xhtml
new file mode 100644
index 0000000..c4bba65
--- /dev/null
+++ b/jquery-text-n-html-funcs.xhtml
@@ -0,0 +1,38 @@
+<!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>text() and html()</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<script type="text/javascript" src="jquery-2.0.2.js"></script>
+<script type="text/javascript">
+ <![CDATA[
+ function purgeList() {
+ $("#list1").html("<li>all gone</li>");
+ $("#cpanel").text("let them have it!");
+ }
+
+ $("document").ready(function() {
+ <!-- selector 'a' is next to the filter, $= denotes 'ends with' -->
+ $("a[href$=\\.mp3]").after(" <img src='small-mp3.png' />");
+ });
+ ]]>
+</script>
+</head>
+<body>
+<h2>Inventory:</h2>
+<ul id="list1">
+ <li><a href="foo.mp3">Van Halen - Panama</a></li>
+ <li><a href="foo.pdf">NPN 4401 BJT Transistor</a></li>
+ <li><a href="foo.pdf">All That Remains - Empty Inside</a></li>
+ <li><a href="foo.mp3">Led Zeppelin - Stairway To Heaven</a></li>
+ <li><a href="foo.html">Boobs</a></li>
+ <li><a href="foo.html">Spam</a></li>
+ <li><a href="foo.mp3">Pink Floyd - On The Run</a></li>
+</ul>
+<h2 style="color: red">Admin:</h2>
+<p id="cpanel">Control panel, click to inform customers</p>
+<button type="button" onclick="purgeList();">Sold Out</button>
+</body>
+</html>
+