Search code examples
jqueryinternet-explorerbuttonbind

how can I bind an event to the clear x button icon in internet explorer (see pic)


I've found that the little x icon in IE 9 and lower does not bind to any of my jquery events like it does in IE 10 (and better browsers like chrome). This is the x icon I'm talking about:

enter image description here

Is there a way I can manually bind this little x icon? I've seen lots of posts on how to hide the x button using css like this:

<style type="text/css">
  ::-ms-clear {
    display: none;
  }
</style>

but I actually wont to bind a click event to this thing. can it be done?


Solution

  • It's not possible to bind to pseudo elements. You can however create a div and position it absolutely over top of it and then bind to that. That should stop the user from clicking the actual x.