name和id的区别?

    技术2022-05-20  33

    Id should be unique. That is, an id should apply to only one elementwithin a page. Lots of elements can share the same "name" however.This is why the DOM gives you "getElementById(SomeId)" to return asingle element, and "getElementsByName(SomeName)" to return acollection of elements.


    最新回复(0)