Search Results

Search found 753 results on 31 pages for 'selectors'.

Page 9/31 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • JQuery select text next to an input checkbox?

    - by Rosdi
    Using JQuery, is there a simple way to select the text immediately after a checkbox? <li>bleh..</li> <li> <input type="checkbox" id="cbx1" value="10" />&nbsp;Very important text. </li> <li>bleh..</li> I want to use jquery to select that "Very important text." minus &nbsp;

    Read the article

  • jQuery: is there a way to make a recursive child selector?

    - by gsquare567
    instead of checking only the immediate children of an element, i would like to recursively check all children of the element. specifically, something like $("#survey11Form>input[type=text]:visible").val(); with the html: <form id="survey11Form" name="survey11Form" action="#" method="post"> <div id="survey11Div"> <fieldset> <legend>TEST'TEST"TEST</legend> <div class="label"> <label test="" title="TEST'TEST" for="answer15"> TEST'TEST"TEST </label></div> <div class="fieldWrapper text required"> <div style="width: 146px;" class="cellValue"> <input type="text" title="TEST'TEST" value="" id="survey11answer15" name="survey11answer15"> should give me the value of that input. the jquery i've come up with does not. any ideas as to what would work in this situation (and all recursive situations)? thanks!

    Read the article

  • Selecting all images in a <td> tag and disabling them

    - by Cen
    My HTML looks something like this: <table class="disabled"> <tr> <td> <input blah blah> </td> <td> <img id="reallyLongASP.NetID" etcetc/> </td> </tr> </table> In all with a class indicated as "disabled", I want to set visibility: hidden on the <img>. I can disable using the crazy id ASP.Net gives, but would like to do a general statement that affects every control in the <table> Thanks for the help in advance,

    Read the article

  • Is it possible to search through json result with jQuery

    - by mickyjtwin
    What I'm trying to achieve, is to output a json list that contains a list of Css classes, and their corresponding url records, i.e. var jsonList = [{"CSSClass":"testclass1","VideoUrl":"/Movies/movie.flv"},{"CSSClass":"testclass2","VideoUrl":"/Movies/movie2.flx"}]; //]]> foreach item in the list I am adding a click event to the class... $.each(script, function() { $("." + this.CSSClass, "#pageContainer").live('click', function(e) { videoPlayer.playMovie(this); return false; }); }); What I'm wondering, is if I can somehow get the corresponding url from the jsonlist, without having to loop through them all again, searching for CSSClass, or adding the url to the link as an attribute?

    Read the article

  • CSS selector for grouped iterations

    - by snaken
    Hi, I have a number of elements that i want to loop through as groups. Consider this HTML: <input class="matching match-1" /> <input class="matching match-1" /> <input class="matching match-2" /> <input class="matching match-2" /> <input class="matching match-2" /> <input class="matching match-3" /> <input class="matching match-3" /> // etc I want a CSS selector that would allow me to loop through these as groups so there would be - using this example - 3 iterations of the loop (one for match-1, one for match-2 and one for match-3). The 1,2,3 etc is a variable used for grouping but this is not fixed so it cannot rely on hard coding of these values. Is this even possible? I'll be using jQuery or prototype not that that should matter really. Thanks

    Read the article

  • Quick help with some jQuery toggle

    - by mplacona
    I have the following code: <script> $(document).ready(function() { $('.toggle_section').click(function(e){ parent = $(e.target).closest("div") objChild = parent.children('div'); $('.sectionContentId').hide(400); $(objChild).toggle(400); }); }); </script> <br /> <div class="box" id="parent_section_1"> <strong> <a class="toggle_section" href="javascript:;">New Section 1</a> </strong> <div class="sectionContentId" id="section_1" style="display: none"> <br /> Contents<br />for<br />section<br />1 </div> </div> <br /> <div class="box" id="parent_section_2"> <strong> <a class="toggle_section" href="javascript:;">New Section 2</a> </strong> <div class="sectionContentId" id="section_2" style="display: none"> <br /> Contents<br />for<br />section<br />2 </div> </div> And example can be seen here As you can see, what I'm trying to accomplish is that when you click on one of the links, all the other "already expanded sections" collapse, and the clicked section expand. this works fine as it is, but obviously by using the logic: $('.sectionContentId').hide(400); $(objChild).toggle(400); When I click one of the expanded sections in the attempt to close it, it closes briefly and opens again. I wanna keep the same functionality, but wanna be able to open and close a section by clicking on a link, as well as when I'm opening a section, I wan't it to close everything before opening this new section. I'm not sure I'm being very clear here, but by looking at the example, you will be able to understand better what I mean. Thnks in advance

    Read the article

  • jQuery selector to identify a div by its size

    - by Anton
    I have few nested DIVs at page. I want to add event only for smalest DIV which size is more than 100x100 px. I am able to do it using conditions in code. Is it possible to do using selector? $('?????').click(function (e) { } If yes, please provide an example.

    Read the article

  • jQuery selecrors. help for newbie

    - by Shamanu4
    Hello. I have this code, which open new jquery-ui dialog and then hide the dialog's titlebar. <div id="keyboard" class="keyboard dialogs">...</div>   $("#keyboard").dialog({ width: 1136, height: 437, position: ['center',400], closeOnEscape: false, autoOpen: false, resizable: false, open: function(event, ui) { $(".ui-dialog-titlebar").hide(); // <-- this selector i want to change } }); But $(".ui-dialog-titlebar") select all titlebars. How do i have change selector to hide only this titlebar?

    Read the article

  • hidden row causing issue with tablesorter zebra striping

    - by Harvengure
    Sorry if this has already been solved elsewhere but my searches have been able to turn up nothing and my attempts at solving the issue myself have made even less progress. :P Put quite simply I have a table that is using the jquery tablesorter and it's zebra widget. In this table there is a hidden column. I've so far been able to make it so that when a tr contains specific text (I was aiming for * but was seemingly unable to get \* to work for whatever reason...and I suspect my selector is perhaps not specific enough) the containing row is set not to display by ".hide()". The problem I am having though is when the row is hidden, tablesorter does exactly what it should do and stripes all the rows their specific colours based on their odd and even values. Of course .remove doesn't do the trick either as the table still sees some funny striping. Any thoughts on how to make it so that when a row is hidden, the striping compensates?

    Read the article

  • How to get the child of an element being dragged with jQuery UI

    - by Walden
    I have the following html: <div id="gallery"> <ul> <li> <a href="url I want to get">link</a> </li> </ul> </div> and some jQuery that allows it to be dropped on another div: $trash.droppable({ accept: '#gallery > li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { deleteImage(ui.draggable); var $flickrparenturl = $("a").attr("href"); //only gets href of <li> #1, not <li> being dragged $.post("updateDB.php", { 'flickrparenturl': $flickrparenturl } ); } }); What is the correct way to get the href attribute of the child of the element being dragged? $("a").attr("href"); is only getting the href of the 1st li on the page, not the one being dragged.

    Read the article

  • Focusing a textarea

    - by Hulk
    Int he below code a textarea is added 6 times and initially the textarea conatins the text Enter Text. My question is, if the user enters data in first and third textareas. How to give alert to the user saying that the "textareas are empty" this is a general message but focus on the 2nd textarea and when the user enters data in 2nd the next textarea should be focused. <script> function ad_R(count) { //Adding and populating table row var row = '<tr>'; row += '<td>'; row += '<textarea rows = "8" cols = "18" border ="0" class="input" style="border:none;overflow:visible;width:100%;" id="details'+count+'" nfocus="if (this.value == \'Enter text\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'Enter text\';" name ="detail'+count+'" class="row_details'+r_count+'">Enter text</textarea></td></tr>'; } $(document).ready(function() { cnt += '<table cellspacing="0" cellpadding="0" border="1" width="100%" id="_table">'; cnt += '<tr>'; cnt += '<th width="30%">Category</th>'; cnt += '</tr>'; for(var i=0;i<6;i++) { cnt += add_R(6); } cnt += '</table>'; });

    Read the article

  • how do I select a div with class "A" but NOT with class "B"?

    - by MedicineMan
    I have some divs: <div class="A">"Target"</div> <div class="A B">"NotMyTarget"</div> <div class="A C">"NotMyTarget"</div> <div class="A D">"NotMyTarget"</div> <div class="A E">"NotMyTarget"</div> Is there a CSS selector that will get me the div containing Target but not the divs containing NotMyTarget? Solution must work on IE7, IE8, Safari, Chrome, and Firefox Edit: So far Nick is the closest. It's clumsy and I don't like the solution, but at least it works: .A { style that all divs will take } div.B { style that will override style .A }

    Read the article

  • Copying values of one table to another (how to convert this js function to jQuery)

    - by Sullan
    Hi All, I am stuck with a small problem here.. What i am trying to do is copy description of id's from one table to another. I have writter half of the javascript and can anybody tell me how to convert this function in jquery. I want the description copied from the first table based on the id to the second table. Have done this in jquery using 'contains', (http://stackoverflow.com/questions/2449845/comparing-2-tables-column-values-and-copying-the-next-column-content-to-the-secon) since there are 1000 table rows, the explorer crashes. Is there a way to simplify it ??... the code is as follows... the current javascript works when i click on test in the second table, but i want the value to be appended in the second table on page load... pls help <table class="reportTabe"> <tr><td>psx-pdu120v1</td><td class="itemname" id="psx-pdu120v1">some description1</td></tr> <tr><td>psx-pdu120v1</td><td class="itemname" id="psx-pdu120v1">some description1</td></tr> <tr><td>psx-pdu120v3</td><td class="itemname" id="psx-pdu120v3">some description3</td></tr> <tr><td>psx-pdu120v4</td><td class="itemname" id="psx-pdu120v4">some description4</td></tr> <tr><td>psx-pdu120v5</td><td class="itemname" id="psx-pdu120v5">some description5</td></tr> <tr><td>psx-pdu120v6</td><td class="itemname" id="psx-pdu120v6">some description6</td></tr> <tr><td>psx-pdu120v7</td><td class="itemname" id="psx-pdu120v7">some description7</td></tr> <tr><td>psx-pdu120v8</td><td class="itemname" id="psx-pdu120v8">some description8</td></tr> <tr><td>psx-pdu120v9</td><td class="itemname" id="psx-pdu120v9">some description9</td></tr> </table> <table class="data"> <tr><td class="whipItem">psx-pdu120v1</td><td onClick="Javascript:alert(document.getElementById('psx-pdu120v1').innerText)";>test</td></tr> <tr><td class="whipItem">psx-pdu120v3</td><td onClick="Javascript:alert(document.getElementById('psx-pdu120v1').innerText)";>test</td></tr> <tr><td class="whipItem">psx-pdu120v4</td><td onClick="Javascript:alert(document.getElementById('psx-pdu120v5').innerText)";>test</td></tr> <tr><td class="whipItem">psx-pdu120v5</td><td Javascript:this.innerText=document.getElementById('psx-pdu120v4').innerText;></td></tr> <tr><td class="whipItem">psx-pdu120v6</td><td Javascript:this.innerText=document.getElementById('psx-pdu120v5').innerText;></td></tr> <tr><td class="whipItem">psx-pdu120v7</td><td Javascript:this.innerText=document.getElementById('psx-pdu120v6').innerText;></td></tr> <tr><td class="whipItem">psx-pdu120v8</td><td Javascript:this.innerText=document.getElementById('psx-pdu120v7').innerText;></td></tr> <tr><td class="whipItem">psx-pdu120v9</td><td Javascript:this.innerText=document.getElementById('psx-pdu120v8').innerText;></td></tr> </table>

    Read the article

  • Backgroung image for a table

    - by Hulk
    How can we integrate a picture as a background image for a table.. <table> <tr> <td><textarea>Some data here.....</textarea> </td> <td></td> </tr> <tr> <td><textarea>Some data here.....</textarea> </td> <td></td> </tr> Thanks..

    Read the article

  • Traversing from Bookmark Hashtags (#bookmark) in jQuery?

    - by HipHop-opatamus
    I am having trouble traversing from a bookmark has tag in jquery. Specifically, the following HTML: <a id="comment-1"></a> <div class="comment"> <h2 class="title"><a href="#comment-1">1st Post</a></h2> <div class="content"> <p>this is 1st reply to the original post</p> </div> <div class="test">1st post second line</div> </div> I am trying to traverse to where the class = "title", if the page is landed on with a bookmark hashtag in the URL (site.com/test.html#comment-1). The following is my code I'm using for testing: if(window.location.hash) { alert ($(window.location.hash).nextAll().html()); } It executes fine, and returns the appropriate html ( The problem is if I add a selector to it ($(window.location.hash).next('.title').html() ) I get a null result. Why is this so? Is nextAll not the correct Traversing function? (I've also tried next+find to no avail) Thanks!

    Read the article

  • jquery how to create a new div, assign some attributes, and create an id from some other elements at

    - by Ronedog
    How can I accomplish this...what I've tried below is not working and I'm unsure how to make it work. What I'm trying to do is create a div and assign it some attributes, then append this div to all the < li elements that are the on the last node of my unordered list. And lastly, but most important I want to retrieve the value of the attribute called "p_node" from the < li that is being appended to and insert it in as part of the ID of the newely created div Here's my current jquery code: $('<div />,{id:"'+ $("#nav li:not(:has(li))").attr("p_node").val() +'_p_cont_div", class:"property_position"}').appendTo("#nav li:not(:has(li))"); Here's the HTML before the div creation: <ul> <li p_node="98" class="page_name">Category A</li> </ul> <ul> <li p_node="99" class="page_name">Category B</li> </ul> Here's what I want it to look like after the new div creation: <ul> <li p_node="98" class="page_name">Category A</li> <div id="98_p_cont_div" class="property_position"></div> </ul> <ul> <li p_node="99" class="page_name">Category B</li> <div id="99_p_cont_div" class="property_position"></div> </ul> Thanks for your help.

    Read the article

  • How can I get jQuery $('.class', context) to include context itself if it matches .class?

    - by Jake
    I want to be able to match against all elements in a given context including the context element itself. Here is the code I'm using currently, but it seems inefficient. Is there a better way? Note: I'm using jQ 1.3.2, but I'll upgrade soon so I'm interested in 1.4 solutions too. var context = $('#id'); var filters = '.class1, .class2'; // take context itself if it matches filters $(context).filter(filters) // add anything matching filters inside context .add($(filters, context)) Note: .add($(f,c)) works in jQ 1.3 as .add(f,c) in jQ 1.4

    Read the article

  • inherit properties and then change some on particular site (css)

    - by Radek
    I have three menus on this test web site. I am learning css and trying all the menus inherit all properties from menu class. The second one looks different and is not clickable. I am happy with the 3rd one, just want to make it horizontal and change its position bit. Could somebody tell me why the second menu is not click-able? how I can make the third menu vertical? I thought that display: block; for li of the 3rd menu would do the trick but I do not know the css path for that li.

    Read the article

  • sIFR header with inside span

    - by Pokepoke
    I've got the following situation: <h2>This text is <span>pretty awesome</span></h2> I'm trying to give both a different style like this (only the css): h2 { font-size: 21px; text-transform: uppercase; line-height: 37px; height: 36px; text-align: right; margin-right: 10px; } h2 span { font-size: 16px; color: #666666; text-transform: lowercase; } Now just calling this like the following things doenst work and only displays the general H2 style: sIFR.replace(headache, { selector: 'h2', css: ['.sIFR-root { stylesforh2 } '], wmode: 'transparent' }); sIFR.replace(headache, { selector: 'h2 span', css: ['.sIFR-root { stylesforspan } '], wmode: 'transparent' }); neither does this work: sIFR.replace(headache, { selector: 'h2', css: ['.sIFR-root { stylesforh2 }, span { stylesforspan} '], wmode: 'transparent' }); I'm a sIFR firsttimer and I'm problably doing something silly wrong, but I cant figure it out. Can someone tell me how its done properly? Using sIFRT version 3, revision 436. Tnx in advance

    Read the article

  • Best practice: How to use (repeat) CSS style attributes correctly?

    - by ellie
    Hi guys! As a CSS newbie I'm wondering if it's recommended by professionals to repeat specific style attributes and their not inherited but default properties for every relevant selector? For example, should I rather use body {background:transparent none no-repeat; border:0 none transparent; margin:0; padding:0;} img {background:transparent none no-repeat; border:0 none transparent; margin:0; outline:transparent none 0; padding:0;} div#someID {background:transparent none no-repeat; border:0 none; margin:0 auto; padding:0; text-align:left; width:720px; ...} or body {background:transparent; border:0; margin:0; padding:0;} img {background:transparent; border:0; margin:0; outline:0; padding:0;} div#someID {background:transparent; border:0; margin:0 auto; padding:0; text-align:left; width:720px; ...} or just what (I think) I really need body {background:transparent; margin:0; padding:0;} img {border:0; outline:0;} div#someID {margin:0 auto; width:720px; ...} If it's best practice to go with the first or second one what do you think about defining a class like .foo {background:transparent; border:0; margin:0; padding:0;} and then applying it to every relevant selector: <div id="someID" class="foo">...</div> Yep, now I'm totally confused... so please advise! Thanks!

    Read the article

  • a selector which has this selector together with a class selector

    - by Woho87
    Here is an analogy of my problem(a selector which has this selector together with a class selector): Let say that I selects all yellow(classes) div elements in a arbitrary HTML document. And I want each to check if the attribute is yes = 1. If the attribute 'yes' equals '1', then I want the child with class 'blue' have the attribute 'no' equals '1'; $('div .yellow').each(function(){ if($(this).attr('yes') == 1){ $(this '.blue:first-child').attr('no', 1);//This line needs to be fixed } }); I know that the line this.getElementsByClassName('blue')[0] fixes this problem. But in my real problem (not this analogy) I want to use addClass and removeClass which only functions with jQuery objects. It is to cumbersome to use other functions than addClass and removeClass. UPDATE: Here is a code snippet from my real problem. I got some problem with "this" in javascript. I want a invited button to have the className visible when I click on it. The button lies within a div element with className 'box'. I know that there are problem with 'this' on the code snippet. But I want the button and not the box to change to visible $('.Box').each(function(){ if($(this).attr('hasButton') != 1){ var invite = document.createElement('div'); invite.className = 'invite invisible'; invite.innerHTML = 'invite'; $(this).attr('hasButton', 1); this.appendChild(invite); invite.addEventListener('mouseover', function(event){ $('.invite', this).removeClass('invisible');//this line is not functioning $('.invite', this).addClass('visible');//neither this }, false); } });

    Read the article

  • jQuery selector

    - by Anton
    I have few nested DIVs at page. I want to add event only for smalest DIV which size is more than 100x100 px. I am able to do it using conditions in code. Is it possible to do using selector? $('?????').click(function (e) { } If yes, please provide an example.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >