About 450,000 results
Open links in new tab
  1. Including both href and onclick to HTML <a> tag - Stack Overflow

    Mar 19, 2019 · The default behavior of the <a> tag's onclick and href properties is to execute the onclick, then follow the href as long as the onclick doesn't return false, canceling the event (or …

  2. How can I trigger a JavaScript event click - Stack Overflow

    Feb 20, 2020 · 44 What l.onclick(); does is exactly calling the onclick function of l, that is, if you have set one with l.onclick = myFunction;. If you haven't set l.onclick, it does nothing. In …

  3. Pass a string parameter in an onclick function - Stack Overflow

    A couple of concerns for me with respect to using string escape in onClick and as the number of arguments grow, it will become cumbersome to maintain. The following approach will have a …

  4. javascript - onclick increment number - Stack Overflow

    With JavaScript, how can I do it so when I click a form button it adds 1 to a number? The number it increments could be in a form text field or something. Obviously it'd be on onclick but I'm not s...

  5. How to set onClick with JavaScript? - Stack Overflow

    Nov 30, 2012 · 55 I am trying to set the onclick event using javascript. The following code works: var link = document.createElement('a'); link.setAttribute('href', "#"); link.setAttribute('onclick', …

  6. How to get the onclick calling object? - Stack Overflow

    How to get the onclick calling object? Asked 16 years ago Modified 1 year, 2 months ago Viewed 281k times

  7. How to prevent default event handling in an onclick method?

    Aug 14, 2011 · 10 Another way to do that is to use the event object inside the attribute onclick (without the need to add an additional argument to the function to pass the event)

  8. javascript - Using "if/else" with OnClick - Stack Overflow

    First of all, is it even possible to write if/else statements directly in html with onclick attribute? And if so, why is my code not working? So this is a button. The "Calc.Input.value" refers to a

  9. javascript - jQuery.click () vs onClick - Stack Overflow

    Sep 28, 2012 · onclick, onmouseover, onmouseout, etc. events are actually bad for performance (in Internet Explorer mainly, go figure). If you code using Visual Studio, when you run a page …

  10. How to display a confirmation dialog when clicking an <a> link?

    May 5, 2012 · In links, propagation of clicks does not have any meaning. If one does not want to rely on return false (as some reported it is not working sometimes), onclick="confirm('really?') …