I am trying to grab text generated by javascript and paste it into a forms input value field. This is what I have so far:
var txt=$('#grabemail').text();
$('#email').val(unescape(txt));
<p id="grabemail" style="color:#fff;">
<script type="text/javascript">formData.display("email")</script>
</p>
The only problem is that when the jQuery grabs the text from #grabemail it not only takes the email but it also takes ‘formData.display’ so I end up with:
formData.display(“email”)user@email.com
In the field as opposed to just the email.
I cannot edit the JS inside of the #grabemail div.
Anybody have any ideas on how to fix this?
have you tried this way?