$(document).ready(function() { $("button").click(function() { alert('Button Text: '+$("button").text()); }); $("#content a").click(function() { alert('HREF Attribute value: '+$("#content a").attr('href')); }); });
<h2>jCombat Demo - jQuery DOM Manipulations</h2> <div id="content"> <p>This is a paragraph. <a href="#">Sample Link</a></p> </div> <button>Click me</button>