I want to set the value on an input element like this:
<input type="submit" name="submit" id="loginButton" value="<script>document.write(language['login'])</script>"/>
but i can't get it to work. Is it not possible?
I want to set the value on an input element like this:
<input type="submit" name="submit" id="loginButton" value="<script>document.write(language['login'])</script>"/>
but i can't get it to work. Is it not possible?
With Javascript, you can attribute a value to the property value
by using setAttribute
function.
Here is a possible solution :
var button = document.getElementById("#loginButton"); //Select your button element
button.setAttribute("value","Your value to set"); //Set value attribute to your element
Good luck !