+ -
当前位置:首页 → 问答吧 → 有点没搞明白type的用法,解释下下面的对错

有点没搞明白type的用法,解释下下面的对错

时间:2011-09-07

来源:互联网

这种情况:
<input type="button" value="Start the Show" onClick ="clearTimeout(the_timeout);rotateImage(0);">
另一种情况:
<input value="Start the Show" onClick ="clearTimeout(the_timeout);rotateImage(0);" type="button">

请问上面的哪种写法对啊,还是都对啊?
谢谢了...

作者: sockethack01   发布时间: 2011-09-07

引用楼主 sockethack01 的回复:
这种情况:
<input type="button" value="Start the Show" onClick ="clearTimeout(the_timeout);rotateImage(0);">
另一种情况:
<input value="Start the Show" onClick ="clearTimeout(the_timeout);rotateImage(0);" typ……



都对啊~·html标签里面的属性没有先后顺序的,写在前面或者写在后面都行~·

作者: MuBeiBei   发布时间: 2011-09-07

两种都对吧,但是肯定是推荐使用第一种方法!如果有错的,估计也是哪个浏览器蛋疼了,语法上是没有错的

作者: Sencha_Android   发布时间: 2011-09-07

两个都行!!但第一种方便read。。。。

作者: BLUE_LG   发布时间: 2011-09-07

两个都对 标签属性不区分顺序 没有关系

作者: fanchuanzhidu   发布时间: 2011-09-07