<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>12 Stix - Tech Answers and Fixes &#187; jquery</title>
	<atom:link href="http://12stix.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://12stix.com</link>
	<description>Tech Answers and Fixes</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:20:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to add onclick values to a list in Jquery</title>
		<link>http://12stix.com/2009/04/07/how-to-add-onclick-values-to-a-list-in-jquery/</link>
		<comments>http://12stix.com/2009/04/07/how-to-add-onclick-values-to-a-list-in-jquery/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 09:32:05 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://12stix.com/?p=173</guid>
		<description><![CDATA[This bit of jquery will add an onclick value to list items based on the link within the list item. The idea is that the whole lists items become links rather than just the link text. Its ideal if you want to colour the background of a list item and have it clickable. &#60;script type=&#34;text/javascript&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This bit of jquery will add an onclick value to list items based on the link within the list item.</p>
<p>The idea is that the whole lists items become links rather than just the link text. Its ideal if you want to colour the background of a list item and have it clickable.</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
$(&quot;li&quot;).each(function(){
var url = &quot;location.href=&#039;&quot;+$(&quot;a&quot;, this).attr(&quot;href&quot;)+&quot;&#039;&quot;;
$(this).attr(&#039;onclick&#039;, url);
});
$(&quot;li&quot;).each(function(){
var url = &quot;location.href=&#039;&quot;+$(&quot;a&quot;, this).attr(&quot;href&quot;)+&quot;&#039;&quot;;
$(this).attr(&#039;onclick&#039;, url);
});
});
&lt;/script&gt;
</pre>
<p>The only downside to this method is if you have a list within a list such as a nested Drupal menu.</p>
<div class="shr-publisher-173"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://12stix.com/2009/04/07/how-to-add-onclick-values-to-a-list-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

