Tell me how to solve this problem:?
Create 3 blocks with id: id_1, id_2 and id_3.
Create a text field in which the user must enter the number 1, 2 or 3.
Create a "Delete" button.
After clicking on the "Delete" button, hide through hide () in the jQuery block with id = id_num_number. For example, if the user entered 2, then the block id_2 should disappear
Solve using jquery. Cheto generally can not figure out how to do?
p / s
<div id="id_1" onclick="$('#test').hide()">1111111</div> <div id="id_2" onclick="$('#test').hide()">2222222</div> <div id="id_3" onclick="$('#test').hide()">3333333</div> <input type="text" value="" id="text"/> <input type="submit" value="Удалить" id="button" onclick=" var element=$('text'); var text = element.val(); alert(text); "/> That's what, I can not get the value of the text field by clicking on the field!