I have a form which has a hidden <div> that shows up when a button is clicked. There are input fields in that hidden <div> that includes buttons
When I first click ‘Add’ the div shows up as it should. I close the div by pressing Cancel and then I reclick ‘Add’ the div shows buttons that have shrunk in size.
check the jsfiddle:
http://jsfiddle.net/uc3Ef/
It’s because you are setting the
valueattribute of allinputelements to nothing and thevalueattribute is used as the label text for the buttons.Change this:
To:
Here is a demo: http://jsfiddle.net/uc3Ef/1/
Also, you do not need to use
.each()here, you can just do this:This works because
.val(STRING)will set the value of all selected elements. Here is the documentation for.val(): http://api.jquery.com/valHere is a demo: http://jsfiddle.net/uc3Ef/3/