 <pre><code>$("input").click(function() { var dataAttr = $(this).attr("data-logic"); if (dataAttr == "yes") { var value = $(this).attr("value"); alert('Has logic ' + value); } }); </code></pre> <p><a href="http://jsfiddle.net/wCRLE/1/" rel="nofollow">http://jsfiddle.net/wCRLE/1/</a></p>