value 和name的区别是什么?可以只写一个吗?
name和id的功能是一样的,同样用来标识html标签,但唯一不同的是name允许有重复的值。
value代表某个html标签的值
打个比方:<input type="text" name="seq" value="hello!" id="seq007" />
你将看到网页中文本框的内容为“hello!”
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D0%C2%C6%CF%BE%A9%CD%F8%D6%B7XS686.%A3%C3%A3%CF%A3%CD
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D0%C2%C6%CF%BE%A9%D3%E9%C0%D6%BF%AA%BB%A7%B9%D9%CD%F8XS686%A1%A4COM
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D0%C2%C6%CF%BE%A9%B6%C4%B3%A1%B9%D9%CD%F8XS686%A3%AE%A3%C3%A3%CF%A3%CD
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%CC%DA%C1%FA%D3%E9%C0%D6%B9%D9%B7%BD%CD%F8%D6%B7B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%C3%E5%B5%E9%CC%DA%C1%FA%D3%E9%C0%D6%B9%D9%B7%BD%CD%F8%D6%B7B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%CD%FE%C4%E1%CB%B9%C8%CB%B9%D9%B7%BD%CD%F8%D6%B7B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%CD%FE%C4%E1%CB%B9%C8%CB%D3%E9%C0%D6%A1%BE%B9%D9%CD%F8%A1%FAB2024.CN%A1%BF
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%CD%FE%C4%E1%CB%B9%C8%CB%B6%C4%B3%A1%D6%B1%D3%AA%CD%F8B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D2%F8%BA%D3%D3%E9%C0%D6%B9%D9%B7%BD%CD%F8%D6%B7B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D3%F1%BA%CD%D3%E9%C0%D6%D6%B1%D3%AA%CD%F8B2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%D3%F1%BA%CD%B6%C4%B3%A1%BF%AA%BB%A7%B9%D9%CD%F8XS686%A1%A4COM
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%C3%E5%B5%E9%D3%F1%BA%CD%D3%E9%C0%D6%BF%AA%BB%A7%B9%D9%CD%F8XS686%A1%A4COM
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%BB%CA%BC%D2%B9%FA%BC%CA%D3%E9%C0%D6%D6%B1%D3%AA%BF%AA%BB%A7%3AB2024.CN
http://biz.finance.sina.com.cn/zjzt/more.php?lytype=ipoly_hyxdly&title=%BB%CA%BC%D2%D3%E9%C0%D6%CD%F8%D6%B7XS686.%A3%C3%A3%CF%A3%CD
name是名字,value是具体值。执行的时候执行value,name只是你起的标识符一样。
value是这个文本框里面显示的内容,name是这个文本框的名字,给后台看的