Reputation: 3
I am confused, I used jQuery to $("#display").html(value)
toward my html input with id ="display"
but nothing appears in the html input.
However we can see the value in the element : "32"
(see picture)
Any idea why the value doesn't appear?
I try to replace input by span and it works well.
image : example thanks,
Thomas
Upvotes: 0
Views: 241
Reputation: 4234
You cannot set the innerHTML
value of an input
element (which is what jQuery is doing when you use $.html()
). Instead, you need to use $.val()
.
Try using $("#display").val(value)
instead.
Upvotes: 3