Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

Changing value of a text box is not working

$
0
0

My HTML(simplified):

<input class="text" type="text" id="emailbox" value="None">

Note: content1 is the ID of a div that contains the email retrieved from a file using PHP and this part works (it returns the email)

My Javascript:

var email = $.trim(document.getElementById('content1').textContent);
if (!email == "") { document.getElementById("emailbox").value = email; }

The value of the input box is not changing at all

The error is with the line

document.getElementById("emailbox").value = email;

or with the html

ALL CODE: https://pastebin.com/5JSLzHdw


Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>