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,261
  • 9
  • 68
  • 109
rubo77
  • 17,707
  • 27
  • 124
  • 213

4 Answers4

2

Try:

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

Do this

$("[name='hiddenElement']").hide().css("position", "absolute");
tymeJV
  • 102,126
  • 13
  • 159
  • 155
1

You use [attribute=value] to select matching elements

$(*[name=hiddenElement]).css({'display':none,'position':'absolute'});
Adam Pietrasiak
  • 11,708
  • 7
  • 73
  • 89
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
  • 34,740
  • 15
  • 87
  • 106