Javascript examples for jQuery:Link
Create an anchor link
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.4.js"></script> <script type="text/javascript"> $(function(){/*w ww.ja v a 2 s . com*/ $('#myDiv').append( $('<a>').append("click").attr('href', 'A sensible fallback').click(function (e) { console.log('TERM'); e.preventDefault(); }) ); }); </script> </head> <body> <div id="myDiv"></div> </body> </html>