mathiasbynens / jquery-placeholder

A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
https://mths.be/placeholder
MIT License
3.98k stars 1.34k forks source link

lte IE9,it will be affected by <a href='javascript:;'>,the text will disappear #290

Closed ccaaiime closed 8 years ago

ccaaiime commented 8 years ago

Is this a bug? work on a weebox , when lte IE9,it will be affected by a href='javascript:;',the placeholder text will disappear! ps. i added a click event on A tag to show the weebox,when the weebox is showed, the placeholder text can't work

i had checked the releases, know that the author fixed this bug , but it still exist.

huoyanwuzhe629 commented 8 years ago

I also met the same question, why?

amerikan commented 8 years ago

Feel free to fix the issue and do a pull request.

andy199310 commented 8 years ago

Is this issue similar to #74 ?

andy199310 commented 8 years ago

btw, I face another issue. I use a tag's onclick event to open jquery-ui's dialog(shown as below), it will auto focus on the tag inside dialog.

<a href="javascript:void(0)" class="forget-password" onclick="$('#dialog-password').dialog('open');" >

As a result, when plugin testing the document.activeElement won't get the a tag which has been click, it will get the element inside the dialog.

https://github.com/mathiasbynens/jquery-placeholder/blob/gh-pages/jquery.placeholder.js#L160

One solution is remove jquery-ui's auto focus function, is there another better solution?

Sorry about poor English, it isn't my native language :( Thanks!

cailingling commented 8 years ago

I also met the same question,who can solve?

moahmn commented 8 years ago

@ccaaiime the problem is fixed?

ccaaiime commented 8 years ago

It's solved , fixed by event.preventDefault()