hasAttribute(s) i Internet Explorer (IE)
- Data:
- 28 maj 2008
- Kategoria:
- Skrypty
Javascript-em możemy sprawdzić czy dany atrybut elementu istnieje za pomocą hasAttribute lub czy w ogóle element ma jakieś atrybuty hasAttributes. Niestety, Internet Explorer do wersji 7, nie zna tych funkcji. Jak z tego wyjść? Dla hasAttributes() użyj attributes.length > 0, a dla sprawdzenia czy dany atrybut istnieje, czyli hasAttribute(attrName), użyj getAttribute(attrName) !== null.
Twój komentarz
Kategorie
- Accessibility (16)
- Aktualności Ikeris (22)
- Artykuły (12)
- CSS (13)
- Flash (4)
- Grafika (2)
- HTML i XHTML (13)
- Oprogramowanie (6)
- Programowanie (18)
- Przeglądarki (23)
- Server side (3)
- Skrypty (7)
- Systemy (2)
- Usability (6)
- Wordpress (11)
Linki
