So, here is my problem: I have a div:
<div id="square"></div>
And an input:
<input type="number" id="width">
And this is my script:
var x;
$("button").click(function(){
x = $("#width").val();
$("#square").attr("width", x);
}
What i want to do is when the user enters a number inside the input, and then clicks a button, div's width is set to the number inside input. Thanks! P.S. Sorry for bad English.