Check for both. if (typeof attr !== typeof undefined && attr !== false) { // Element has this attribute }. Native JavaScript has a way.
確定! 回上一頁