<input type="text" placeholder="Password" id="password" name="password" />
<script>
console.log(password);
</script>
The code above outputs the following in the console:
<input type="text" placeholder="Password" id="password" name="password">
Noticed this when I outputted a variable password
and noticed the HTML was prepended. Is that normal behaviour? What do we have getElementById
for in that case?