Form:has selector does not work on IE

Posted by Joel on Stack Overflow See other posts from Stack Overflow or by Joel
Published on 2010-05-16T14:01:11Z Indexed on 2010/05/16 14:10 UTC
Read the original article Hit count: 166

Filed under:

Hey,

I am trying to use "form:has" selector which works on Chrome but not on IE.

http://jsbin.com/uvumu/2

Does anyone have any idea why it is not working on IE? (when pushing the Post button there should be an alert box)

Edited:

Here is the code:

JS:

  $(document).ready(function() {

    $(".comment-link").live('click',function() {
      return false;
    });

    $("#morefeeds-link").click(function () {
      return false;
    });
    // Form submittion - doesnt work
    $("form:has(.commentBtn)").live('submit',function () {
       alert("a");
      return false;
    });

    return false;
  });?

HTML

<form>

  <a href="#" class="comment-link" style="font-size:12px;">Comment</a>

    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="middle">
          <input type="hidden" name="commentkey" value="1">
          <input type="text" name="commenttext" class="commentfocus" value="Express your opinion">
        </td>
        <td valign="middle"><input type="submit" class="commentBtn" value="Post"></td>
      </tr>
    </table>

 </form>

© Stack Overflow or respective owner

Related posts about jQuery