jQuery plugin to get and set Element#style.display


/ Published in: jQuery
Save to your folder(s)

Plugin to get and set Element#style.display (e.g. "none" or "")


Copy this code and paste it in your HTML
  1. $.fn.display = function(setTo) {
  2. if (setTo) {
  3. return this.each(function(i, el) {
  4. el.style.display = setTo;
  5. });
  6. }
  7. if (!0 in this) {
  8. return false;
  9. }
  10. return this[0].style.display;
  11. };

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.