Jump to content

replace a (partial) value of an attribute by another value? jQuery possible.


pstein

Recommended Posts

Assume I have an element like:

 

<div class="aaa" myattribute="foobar1111" .....>....</a>

 

The classname "aaa" is unique.

 

1.) How can I replace "foobar1111" completely (!) by "dummy2222" from javascript/jQuery?

 

2.) How can I replace ONLY "1111" inside the attribute by "2222" AND keep the remaining (possible unknown) text inside the attribute value whatever it is?

 

If it is more comfortable jQuery could be used.

 

Peter

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...