I am creating a html file called test.html. Using JavaScript, I have parsed a URL to obtain the parsed parameters.
The URL looks something like this (Example URL)
http://path.to.a.webserver/test.html?p1=welcome&p2=home
After parsing the values, I want to send the parsed values to an HTML img tag in the following format. When I hit the above URL, the values p1 and p2 gets parsed and img tag in the test.html file gets executed.:
<img src="http://example2.com/tiger.gif?p1={p1_parsed_value}&p2={p2_parsed_value}"
I have tried using document.getElementById. I'm not sure if it is right. How can I pass only those parsed URL values into the src of the img tag?