How to hyperlink a div using Jquery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • John Mathew
    New Member
    • Nov 2011
    • 1

    #1

    How to hyperlink a div using Jquery

    I have a div like this:

    <div id="test">sampl e test</div>

    I need to hyper link the whole div using javascript or Jquery...
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    jQuery IS javascript and you don't need a big library like that just to do what you want. This is not the javascript board and you should ask there.

    However, you should keep in mind that adding a link to a div is invalid in HTML4.01 and only recently made valid with HTML5.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      You mean <a><div></div></a>? Why do you need javascript for that?

      Comment

      Working...