What is the code required to delete all “weight” tags?

What is the code required to delete all “weight” tags?
A. delete weight(pt).all;
B. delete pt.element[all];
C. delete pt;
D. delete pt..weight;
 
Answer: d
Explanation: Delete is a keyword in javascript which is used for deleting objects ,pointers and variables. Removing attributes and tags is very easy with the standard delete operator :
Code:
delete pt..weight; //delete all <weight> tags
 

Tìm kiếm

Back
Top