I am making a coupon code page and i am struck in one thing, Maybe its easy for javascript buddies.The problem is
- All output links are in one line, I want each link in different text area and able to copy from textarea
HTML Markup
<p>Enter your email or User ID
<input type="text" name="foo" id="foosite" value="" />
</p>
<a href="#" id='link' target="_blank">send</a>
<div id="url_value"></div>
Javscript Code
var a = document.getElementById('link')
a.onclick = function(e){
e.preventDefault();
var value = document.getElementById('foosite').value;
var route = "http://www.domain.com/route.php?email=" + value + ', ';
var data = "http://www.domain.com/data.php?email=" + value + ', ';
var form = "http://www.domain.com/form.php?email=" + value;
document.getElementById('url_value').innerHTML = route + data + form
}
From the above code, Its generate all links in one line and looks ugly, I need it to show in 3 different textareas.
Like this Html
<p>Link 1</p>
<textarea name="route"> Output Link</textarea>
<p>Link 2</p>
<textarea name="data"> Output Link</textarea>
<p>Link 3</p>
<textarea name="form"> Output Link</textarea>