javascript - Create a div containing target div using jQuery -


I think it should be easy, but I'm not able to work it out. I want to target a div or other element using jQuery and then want to create a device with a dynamically-targeted element, for example:

jQuery ('. Myclass')

How can I create a div with the background-color attribute in which the 'myclus' element is set to white?

Initially I have: & lt; Div class = "myclass" & gt; Some HTML elements & lt; / Div & gt;

And after executing the jQuery call, I have to: & lt; Div style = "background-color: #fff" & gt; & Lt; Div class = "myclass" & gt;

Post-text "itemprop =" text ">

You can use the function to insert a cover around the matching elements. I prefer to use a square for background, but you can also assign CSS attributes directly to the background. / P>

  $ ('. Myclass'). Rap ​​($ (' (div = gt; & lt; / div & gt; '). CSS (' background-color ',' # FFF ');. (' (Lt; div>  '')) AddClass (' 

or

  $ (' . Myclass') White Background '));  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -