" />
Mots clés : javascripthtmlperformanceoptimizationhrefjavascript
97
function doSomething() { //Some code return false; }
onclick="someFunc.call(this)"
onclick="someFunc.apply(this, arguments)"
90
// Cancel click event $('.cancel-action').click(function(){ alert('Cancel action occurs!'); }); // Hover shim for Internet Explorer 6 and Internet Explorer 7. $(document.body).on('hover','a',function(){ $(this).toggleClass('hover'); });
a { cursor: pointer; color: blue; } a:hover,a.hover { text-decoration: underline; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a class="cancel-action">Cancel this action</a>
78
button.link { display: inline-block; position: relative; background-color: transparent; cursor: pointer; border: 0; padding: 0; color: #00f; text-decoration: underline; font: inherit; }
<p>A button that looks like a <button type="button" class="link">link</button>.</p>