Can anyone give me a "trick" how to pass input value to "a" element onclick function.
Let say i have input field with specific id:
<input id="yourname" type="text" value="Testing Value" class="form-control" type="text" placeholder="Your name here..." >
and function "exportText" which actualy export text (html) from specific div id (biography):
<a href="#" onclick="exportText('biography', 'Name of player');">
Save your biography
</a>
When you click a href link it will save biography in txt document with name: "Name of player.txt"
How can i force the function to actually grab the input id "yourname" value and save the .txt document with that name, something like "yourname+.txt"
I really tried to search a solution over the net, but my knowledge is too low to found an answer on myself.
Thank you so much!