阅读背景:

在JS中使用同一个节点多次使用appendChild

来源:互联网 

I'm writing a form validation script for a form with multiple ratings, and I'd like to insert a bit of text that says "give a rating!" for each rating the user misses. I wrote the code below to do this, but I'm running into a problem where the give_rating node is only appended to the last node on the form. I know that this is because appendChild basically moves a node instead of duplicating it, and I tried solving this using cloneNode but that just breaks my JS entirely.I'm writing a form validation script for a form




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: