0

I would like to change all elements, that have the name "hiddenElement" with jquery

alle elements should get the style

style.display='none';
style.position='absolute';

How is the syntax in jquery?

Omar
  • 32,302
  • 9
  • 69
  • 112
rubo77
  • 19,527
  • 31
  • 134
  • 226

4 Answers4

2

Try:

  $("[name='hiddenElement']").hide().css("position","absolute");
Rajiv007
  • 1,126
  • 7
  • 13
2

Do this

$("[name='hiddenElement']").hide().css("position", "absolute");
tymeJV
  • 103,943
  • 14
  • 161
  • 157
1

You use [attribute=value] to select matching elements

$(*[name=hiddenElement]).css({'display':none,'position':'absolute'});
Adam Pietrasiak
  • 12,773
  • 9
  • 78
  • 91
0

I believe "name" should be unique(unless your talking about radio buttons). Do you mean "class"?

$(document).ready(function() {
    $('.hiddenElement').css({'display':'none','position':'absolute'});
});
Turnip
  • 35,836
  • 15
  • 89
  • 111