Jump to content

Search the Community

Showing results for tags '.each()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Please consider the two following sets of code and explain why the Javascript not work and suggest an alternative where possible. There are zero complaints from the Javascript console. None. And, the var podType is properly identified. I have checked with console.(log) The procedure does not even turnover for the final element. I am baffled. <script> $(document).ready(function() { $('li.podDex').each(function(){ var podType = $(this).attr('id'); $('#podType').mouseover(function() { $(this).css({"cursor": "pointer", "font-weight":"800"}); }) .mouseout(function() { $(this).css("font-weight", "normal"); }); $('#podType').mouseover(function() { $(this).css({"cursor": "pointer", "font-weight":"800"}); }) .click(function() { var chrono_var = $("#chronology_div").html(); $("#main").html(chrono_var); }) .mouseup(function() { $(this).css({"color": "#fadb9d","font-weight": "normal"}); $('body, html').animate({scrollTop: $('#main').offset().top},800); }); }); }); </script> <ul> <li id='linear' class='podDex'>Linear Analysis</li> <li id='clausal' class='podDex'>Clausal Analysis</li> <li id='inversion' class='podDex'>Socratic Inversion</li> <li id='chronology' class='podDex'>Chronology</li> </ul> Mind you, in isolation, when podType refers directly to the appropriate id attribute, what is included in the .each() function works fine! Roddy
  2. I have "Checkbox" input with multiple values. <input type="checkbox" name="drug" value="1" /><input type="checkbox" name="drug" value="2" /><input type="checkbox" name="drug" value="3" /> I want to run through this array and alert() all the values. I'm guessing I should use Jquery's .each() command but I'm not sure how to use it. the problem is, I don't understand how to use it so I can get the key and it's value. $.each($("input[name='drug']"),function(i,v){ alert(i+": "+v);}); What am I missing in the main idea?
×
×
  • Create New...