系统消息
流浪者
或许,考点主管是个傻逼,昨日成人高考,提前半小时出考场,而且这都有语音播报说提前交卷出考场,结果硬是锁在校门口不让出去,一直挨到11点40才开门,等了40分钟,其中包括一大批人为了赶车的考生,说打电话,领导却是不想担责任,说为了防止试卷泄露,我只想说CNMB,你舒舒服服的坐办公室,校门口都特么快打起来了,这你就不怕担责任了? 没见过这样的,说的好像试题考完还有不泄露的一样。 考点:长沙市北雅中学 温馨提示,这种考试买票不要再抱踩点心理,避免出行受傻逼影响~
2017-10-30 08:39来自:PC
阅读全文 (418)
流浪者

 var obj = document.createElement("input");
         obj.name = 'namenamenamename';//主角
         obj.id = 'idididid';//龙套 只为显示
         obj.value = "valuevaluevaluevalue" //龙套 只为显示      
         alert(obj.outerHTML);

        这段代码10个人会10个人说没问题,但是结果确出乎意料。

    <INPUT id=idididid value=valuevaluevaluevalue>

    name不见了。。。。(为什么不见了,请大家告诉我。)


这是因为运行时可以修改表单域的name属性,但是这不会修改提交表单的集合中的name,用createElement创建元素时要直接把name写进来

意思是这个name虽然是可读写的,但是只能在创建时就写入进去。

var oAnchor = document.createElement("<A NAME='AnchorName'></A>");


NAME Attribute | name Property 

Syntax

HTML <ELEMENT NAME = sName... > 
Scripting object.name [ = sName ] 

Possible Values

sName String that specifies or receives the name. 

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

When submitting a form, use the name property to bind the value of the control. The name is not the value displayed for the input type=button, input type=reset, and input type=submit input types. The internally stored value, not the displayed value, is the one submitted with the form.

Microsoft JScript® allows the name to be changed at run time. This does not cause the name in the programming model to change in the collection of elements, but it does change the name used for submitting elements.

The NAME attribute cannot be set at run time on elements dynamically created with the createElement method. To create an element with a name attribute, include the attribute and value when using the createElement method.

Examples

The following example shows how to set the NAME attribute on a dynamically created A element.

var oAnchor = document.createElement("<A NAME='AnchorName'></A>");

2017-5-12 10:12来自:PC
阅读全文 (591)
Back to Top