Home > Article > Web Front-end > What should I do if there are still values after display:none is hidden?
I used to think that after display:none, its value would no longer exist. After display:none was hidden, if the form had a value, its value would still exist. (There is a problem with the project!!)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Document</title><script src="jquery-1.7.1.min.js?1.1.11"></script></head><body><div style="display:none;"> <input type="text" value="11" name="ceshi" class="buytt" /></div><input type="button" value="提交" class="yang" /><script type="text/javascript">$(document).ready(function(){ $(".yang").click(function(){var data = $(".buytt").val(); alert(data); }); });</script></body></html>
2.
##
The above is the detailed content of What should I do if there are still values after display:none is hidden?. For more information, please follow other related articles on the PHP Chinese website!