jQuery html in Firefox ignores DOM changes_jquery_脚本之家

来源:http://www.pykjg.com 作者:一分快三官网 人气:197 发布时间:2020-02-09
摘要:DOM: 复制代码 代码如下: functionDisplayTextBoxValue(卡塔尔(قطر‎{ var element = document.getElementById; // set theattribute on the DOM Element by hand - will update the innerHTMLelement.setAttribute('value', element.value卡塔

DOM: 复制代码 代码如下: function DisplayTextBoxValue(卡塔尔(قطر‎{ var element = document.getElementById; // set the attribute on the DOM Element by hand - will update the innerHTML element.setAttribute('value', element.value卡塔尔; alert(document.getElementById.innerHTML卡塔尔国; return false; } jQuery plugin that makes .formhtml(卡塔尔国 automatically do this: 复制代码 代码如下: { var oldHTML = $.fn.html; $.fn.formhtml = function(State of Qatar { if return oldHTML.apply; $("input,textarea,button", this卡塔尔(قطر‎.each { this.setAttribute; }State of Qatar; $(":radio,:checkbox", thisState of Qatar.each { // im not really even sure you need to do this for "checked" // but what the heck, better safe than sorry if this.setAttribute; else this.removeAttribute; $.each { // also not sure, but, better safe... if this.setAttribute('selected', 'selected'卡塔尔国; else this.removeAttribute; return oldHTML.apply; }; //optional to override real .html(卡塔尔国 if you want // $.fn.html = $.fn.formhtml; }State of Qatar;

本文由一分快三平台发布于一分快三官网,转载请注明出处:jQuery html in Firefox ignores DOM changes_jquery_脚本之家

关键词:

最火资讯