form acrion="#" action="" 和不写有什么区别_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:59:36
Original
1305 people have browsed it

如题,action,提交到了本页面,刷新了,action=“”,刷新了,对应里面有input标签之类的按回车也会自动提交,但是action="javascript:void(0)",这样,可以不提交,回车也触发不了。但是这种写法科学吗?


回复讨论(解决方案)



action什么不写就表示当前路径
写了部分表示相对路径  比如 # 就认为是当前路径带#

javascript:void(0)
表示执行javascript协议

支持1楼的回答

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!