About 586,000 results
Open links in new tab
  1. html - How to call javascript from a href? - Stack Overflow

    May 2, 2013 · If you only want to process a function and not process the href it self, add the return false statement at the end of your function: <a href="#" onclick="javascript: function() {... ; …

  2. Using HREF JavaScript to Call JavaScript Functions in HTML Links

    Feb 13, 2024 · Traditionally, the href attribute points to a URL, defining the link's destination. However, JavaScript introduces a paradigm shift by allowing the href attribute to execute …

  3. HREF JavaScript: Call JavaScript Functions - Udemy Blog

    To call a JavaScript function, you can use the HREF attribute of an HTML Link, using HREF JavaScript. Take a look at how it works.

  4. JavaScript: Callbacks with href vs onclick for Links and Buttons

    Nov 1, 2023 · Callback functions are invaluable in JavaScript for handling complex asynchronous logic and creating clean, maintainable code. When adding callbacks to links and buttons, …

  5. Using Links to Call JavaScript: A Step-by-Step Tutorial

    Apr 11, 2022 · By adding an event listener to the link, we can specify a JavaScript function to be called when the link is clicked. To get started, let’s create a basic HTML link. We can do this …

  6. A href JavaScript function call | Simple Code - EyeHunts

    Jun 4, 2021 · Use javascript:void(0) as value of href and onclick method function name to call JavaScript function. Or use javascript:method_name n href...

  7. JavaScript - href vs onclick for callback function on Hyperlink

    In terms of javascript, one difference is that the this keyword in the onclick handler will refer to the DOM element whose onclick attribute it is (in this case the <a> element), whereas this in the …

  8. [JavaScript] How to Invoke JavaScript Functions Using `<a href>`

    Aug 29, 2023 · In modern web development, invoking JavaScript functions using HTML elements is a standard practice. One such element, <a href>, commonly used for hyperlinks, can also …

  9. JavaScript Function in href vs onClick - Online Tutorials Library

    Learn the differences between using JavaScript functions in href attributes and onClick events in this detailed guide.

  10. Links used to activate JavaScript functions - flaviocopes.com

    Sep 21, 2019 · When you are creating an app using plain JavaScript, sometimes you’ll have the necessity of triggering a function when the user clicks a link. You can commonly do this in 2 …

Refresh