attr

IE7 / IE8 interaction with JQuery .removeAttr('disabled'), not applying css

半城伤御伤魂 提交于 2019-12-23 13:53:34
问题 This is more of a curiosity than a question, but I'm wondering why the following isn't working. Say I have an html form with a selector and a submit button. <form action="/foo/createActivity" method="post" name="activityform" id="activityform" > <select name="activity" id="activity" > <option value="1" >Activity 1</option> <option value="2" >Activity 2</option> </select> <input type="submit" class="submit" id="add" value="Add >>"/> </form> Then I have an ajax call with jQuery defined $('

How to edit a jquery function

て烟熏妆下的殇ゞ 提交于 2019-12-23 09:29:54
问题 I'm trying to modify the 'attr' function in the jQuery (V.6.1) core. I have a plugins.js file that's included in the page after the jquery-6.1.js file. The plugins.js file contains improvments made to various jQuery core functions to accomodate some SVG functionality. I've copied the attr function into the plugins.js file without modifying it, but it now produces a JavaScript error when it's called. Does anyone know why this particular function doesn't like to be overwritten (I'm probably

TinyMCE and jQuery - attr() is returning an Object

↘锁芯ラ 提交于 2019-12-23 07:33:26
问题 I've solved this by using data() instead of attr() , but I'd still like to know if this is just me, and what's causing it: I'm using jQuery 1.7.1 and TinyMCE 3.5b3 (jQuery package). No other JS libraries. This code outputs "string", and the anchor tag's href, as expected, when the link is clicked. $('a.page_item_delete').on('click', function(event){ event.preventDefault(); var $this = $(this); console.log(typeof $this.attr('href')); console.log($this.attr('href')); }); When I activate TinyMCE

Transform input type text to password [duplicate]

泪湿孤枕 提交于 2019-12-22 12:38:23
问题 This question already has answers here : Changing the type of an input field using jQuery (text -> password) (5 answers) Closed 6 years ago . I want to change the input type to password when I click on it. I tried this: <input name="pin" id="cp_serv" type="text" class="pin_v" value="Insert PIN Please" onclick="this.value='';$(this).attr('type','password');"/> I tried to use the jQuery function attr to change this on the click event, but nothing is happening. Is this the right way to do it or

Jquery length of attribute undefined

南笙酒味 提交于 2019-12-22 09:56:53
问题 How can I check the lenght of the string that is in the attribute?This shows 'undefined' value: var action = $(obj).closest("form").attr('action'); alert(action.lenght); 回答1: Your spelling is just a bit off, .lenght should be .length: var action = $(obj).closest("form").attr('action'); alert(action.length); 回答2: Always goto api when some method is not found before you make a post somewhere. http://api.jquery.com http://api.jquery.com/length/ 来源: https://stackoverflow.com/questions/4376276

Loss of attributes despite attempts to preserve them

别来无恙 提交于 2019-12-21 19:16:14
问题 The problem that I have with make always rebuilding Makefile targets (make always rebuilds Makefile targets) and its investigation uncovered another issue , which is the subject of this question. Repeated execution of the following R code results in a loss of objects' attributes during data transformation operations. For the record, I have to say that I've already written on this subject (Approaches to preserving object's attributes during extract/replace operations), but that question and

CSS attr() concatenation with url path [duplicate]

亡梦爱人 提交于 2019-12-19 08:29:52
问题 This question already has answers here : string concatenation in css (5 answers) Closed 2 years ago . How can I concatenate the CSS attr() selector with static text in a url() field? The HTML I use: <div image='/Require/static.png'></div> //Example 2 <div image='static.png'></div> //Example 3, 4, 5 For example: //image attribute contains the image name (and prefix location when needed, see example 2) div[image]:before { background-image: url('/Image/static.png'); //Works background-image: url

Should href be set with prop() or attr()? [duplicate]

为君一笑 提交于 2019-12-18 18:36:43
问题 This question already has answers here : How to change the href for a hyperlink using jQuery (11 answers) .prop() vs .attr() (17 answers) Closed 6 years ago . If I want to change the href of a link dynamically, should I do so using prop() or attr() ? 回答1: You would use .attr() , as .prop() is more commonly used for boolean properties such as checked , selected , etc - though it is certainly possible with .prop it's arguably less clear as per your intent Though I do believe that ultimately

delay() and fadeOut() don't delay attr() in the queue

一世执手 提交于 2019-12-18 12:28:17
问题 what is wrong in this code? I'm trying to get this effect: fadeOut(500) and attr('class','myClass') delayed by 600 millisecs.. then delay(600) again, and fadeIn(500) . The delays happen correctly but the attr() is not being delayed, it fires when #myDiv is still fading! :'( $('#myDiv').fadeOut(500) .delay(600) .attr('class','myClass') .delay(600) .fadeIn(500); 回答1: The .delay() only affects the animation or fx queue (unless you specify a different queue specifically). Keep in mind that

delay() and fadeOut() don't delay attr() in the queue

风格不统一 提交于 2019-12-18 12:28:13
问题 what is wrong in this code? I'm trying to get this effect: fadeOut(500) and attr('class','myClass') delayed by 600 millisecs.. then delay(600) again, and fadeIn(500) . The delays happen correctly but the attr() is not being delayed, it fires when #myDiv is still fading! :'( $('#myDiv').fadeOut(500) .delay(600) .attr('class','myClass') .delay(600) .fadeIn(500); 回答1: The .delay() only affects the animation or fx queue (unless you specify a different queue specifically). Keep in mind that