• Main Menu
  • How to Make JavaScript Links

    Links are basically small web components/elements and they help a user to navigate from one part of a web page to another or to an external website. These links also play a very crucial role in the world of Search Engines and SEO.

    There are multiple methods to create a link.

    • Using the <a> tag
    • Using JavaScript

    Normal <a> Tag

    It’s quite simple to create a HTML link. The code for the same will be:

    <a href="http://www.tech-faq.com" target="_blank">Tech FAQ</a>

    This is how the above mentioned code will function: Tech FAQ

    Using JavaScript

    Many a times, a developer may need to use JavaScript to build links. This could be for multiple reasons.

    Note: Many webmasters want to make JavaScript links instead of HTML links because they believe this will “conserve PR”. This is an unresolved argument among search engine optimization specialists.


    To create a link using the window.open method, the code will be:

    <a href="javascript:var handle=window.open('http://www.tech-faq.com')">Tech FAQ</a>

    The above mentioned code will work like this: Tech FAQ

    click() of JQuery

    If you are using JQuery in your development, you can use the click() function to generate a click event on any HTML element.

    <script type="text/javascript">
    $( document ).ready( function() 
         $( 'div.click-me' ).click( function() 
              // Do something on the click event
    <div class="click-me"> Click here </div>

    An Alternative to JavaScript Links

    An alternative to JavaScript links is to create PHP-scripted links. To create PHP-scripted links, try the Via toy from SEO-Toys.

    PHP is a server-side technology, and does not rely upon client-side browser support. Many users disable JavaScript in their browsers, or use browsers which do not support Javascript.

    Got Something To Say:

    Your email address will not be published. Required fields are marked *

    Web Publishing
    } 166 queries in 0.264 seconds.