I have the following form
<form action="http://www.domain.com/processing.php?page=first§ion=77&userid=replaceme">
how using jquery can I update 'replaceme' with a jquery variable?
I have the following form
how using jquery can I update 'replaceme' with a jquery variable? |
||||
|
I think you should use a regular expression and match the name of the "userid" parameter, rather than the "replaceme" value. Try:
Where Note: In your html, the "&" characters in the URL should be replaced with the character entity UPDATE: Using the suggestion from @undefined, this would be:
Now there's no need for the Here's a jsfiddle demo showing the following cases:
Explanation of the regular expression:
|
|||||||||
|
First add an ID:
Then on DOM ready:
|
|||
|
Let's say that you have the following markup:
and you want to change some text in the
|
|||
|