Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.
To add the migrate code just use this: –
1 2 3 |
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script> |
Main code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<input type="text" name="name" id="name" /> <script src="http://code.jquery.com/jquery-1.8.2.js"></script> <script> $(document).ready(function(){ if($.browser.msie){ $("#name").attr("value", "Type your answer here ie"); } else { $("#name").attr("placeholder", "Type else"); } }); //end </script> |