---
title: "setAttribute 猫腻"
author: "fishhappy365"
date: "2009-09-14T16:36:46Z"
tags: []
slug: "setattribute"
draft: false
lastmod: "2009-09-14T16:36:46Z"
id: 468488
url: "https://fishhappy365.iteye.com/blog/468488"
---

setAttribute 这个方法一定要注意,有三个参数 
object.setAttribute(sName, vValue [, iFlags])

last arg 
iFlags: Optional. Integer that specifies one the following flags: 0 When the attribute is set, it overwrites any attributes with the same name, regardless of their case. （替换已经存在的）
1 Default. The case of the attribute that you set is respected when it is set on the object.（直接添加）