javascript - Append data from div to link url -


i trying have div element on every page of site contain product number , have link put number @ end. example,

<div id="productnumber">01101</div> <a href="purchaseurl">https://example.com/#</a> 

then put contents of element id "productnumber" after # of link.

any idea if possible? since make life easier editing existing pages , respective php files.

check element.innerhtml. use inline js , append href-attribute (which should id="purchaseurl" now)


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -