[removed] not working correctly in IE7/8

后端 未结 4 1267
天命终不由人
天命终不由人 2020-12-21 05:16

I have a div which has an a inside it. I want to click on the div and follow the same url as the a. This is the HTML:

4条回答
  •  旧时难觅i
    2020-12-21 05:39

    Not exactly a direct answer to you question but I have two suggestions

    1. You may just want to try to see if jQuery will handle it for you

      $(this).children('a').first().click()
      

      Edit: This did not solve the problem

    2. Also you may just want to make the whole in to an tag with style="display: block; text-decoration: none". You can use font colors and underlines to make the text inside look however you want. Also, this solution does not require JavaScript. and it also makes the whole div show as focused instead of just the a or nothing at all.

提交回复
热议问题