javascript - setting style with jquery to paragraphs in a div -
its simple setup css , line of javascript make changes:
#pass p { overflow: hidden; width: inherit; }
<div id="pass"> <p></p> <p></p> </div>
$("#pass > p").setstyle({backgroundcolor:$('colorpicker3').style.backgroundcolor});
does know how set style of paragraphs jquery ? thank you
you should use css()
method set style of element in jquery:
$("#pass p").css('background-color', $('colorpicker3').css('backgroundcolor'));
note however, it's better practice set styles in css , use addclass
set on required elements. also, $('colorpicker3')
selector not correct. assuming it's class
need precede .
, or if it's id
needs #
.
Comments
Post a Comment