Hi.

   I’m doing something dumb with jquery, but I can’t put my finger on what
is causing my problem.

    I’m trying to debug some jquery code and I wanted to list the html of
each element that I’m picking up from my select list.


 

I have a shrunken down sample of what I’m doing below..     
the first alert shows something that looks like a java object, the second
alert bombs and the loop exits.


 Can any of you offer any tips or guidance ?     Thanks very much in advance
!

 

 

   Chris

 

 

 

 

 

<!DOCTYPE html>

<html>

<head>

  <link type="text/css"
href="http://jqueryui.com/latest/themes/base/ui.all.css"; rel="stylesheet" />

  <script type="text/javascript"
src="http://jqueryui.com/latest/jquery-1.3.2.js";></script>

  <script type="text/javascript"
src="http://jqueryui.com/latest/ui/ui.core.js";></script>

  <script type="text/javascript"
src="http://jqueryui.com/latest/ui/ui.draggable.js";></script>

  <script type="text/javascript"
src="http://jqueryui.com/latest/ui/ui.resizable.js";></script>

  <script type="text/javascript"
src="http://jqueryui.com/latest/ui/ui.dialog.js";></script>

  <script type="text/javascript">

  $(document).ready(function(){

 

    alert('hello box');

 

 

     $("div.disabled label").each (

             function() {

                 alert("got a label" + this);

                 alert("got a label" + this.html());       //   THIS FAILS.

     });

 

 

 

 

 

  });

  </script>

</head>

 

<body class="yui-skin-sam" style="height: 100%;">^M

<div id="spinner" class="spinner" style="display: none;">^M

   page_files/spinner.gif ^M

</div>^M

^M

^M

^M

^M

<div id="body">^M

 

 

          <div class="column five disabled">^M

            <label style="color: orange;" for="utility-status">Utility
Status</label>^M

 

            <select style="color: orange;" name="utilityStatus.id"
id="utility-status">^M

<option value=""></option>^M

<option value="6862">foo</option>^M

<option value="6863" selected="selected">bar</option>^M

<option value="6864">big</option>^M

<option value="6865">small</option>^M

<option value="6902">Closed</option>^M

<option value="3756">Cancelled</option>^M

<option value="6859">On Hold</option>^M

</select>^M

          </div>^M

 

</div>^M

 

 

^M

<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content
ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible">

</div></body></html>

-- 
View this message in context: 
http://www.nabble.com/how-to-get-at--jquery-elements-when-i%27m-looping-through-a-jquery-select-list-with-%27each%27-tp25716736s27240p25716736.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to