placeholder-10.html 824 B

12345678910111213141516171819202122232425262728
  1. <!DOCTYPE html>
  2. <html class="reftest-wait">
  3. <!-- Test: when unfocused, if value='', newest placeholder should be shown -->
  4. <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
  5. <script type="text/javascript">
  6. function focusPlaceholder()
  7. {
  8. document.getElementById('p1').focus();
  9. }
  10. function setPlaceholder()
  11. {
  12. document.getElementById('p1').placeholder = 'my placeholder';
  13. }
  14. function unFocusPlaceholder()
  15. {
  16. document.getElementById('p1').blur();
  17. }
  18. function disableReftestWait()
  19. {
  20. document.documentElement.className = '';
  21. }
  22. </script>
  23. <body onload="focusPlaceholder();">
  24. <input type="text" id="p1" value="" placeholder="old placeholder" onfocus="setPlaceholder(); unFocusPlaceholder(); disableReftestWait();">
  25. </body>
  26. </html>