Could someone give help for looping,I want to highlight all of the
items called a.My code is following: Thanks
%@ taglib uri=http://struts-menu.sf.net/tag; prefix=menu%
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html%
html
HEAD
%@ page language=java contentType=text/html; charset=ISO-8859-1
pageEncoding=ISO-8859-1%
META http-equiv=Content-Type content=text/html;
charset=ISO-8859-1
META name=GENERATOR content=IBM Software Development Platform
META http-equiv=Content-Style-Type content=text/css
TITLEtry/TITLE
script type=text/javascript src=jquery.js/script
script type=text/javascript
$(document).ready(function(){
$(#searchId).click(function(){
var inputTxt=$(#keyWordText).get(0).value;
var hightField=$(div).attr(id);
$(div).css(background-color,white);
var a=HealthCareServices;
if(inputTxt==hightField||inputTxt.contains(hightField)){
//$(#+hightField).addClass(test);
$(#+inputTxt).css(background-color,blue);
}else{
$(#+inputTxt).css(background-color,white);
}
return false;
});
});
/script
/HEAD
BODY
table border=0 width=270
tbody
tr
td width=50/td
td
input type=text name=input
id=keyWordText size=20
value=/input
p/p
input type=button id=searchId
name=search value=search
/input
/td
/tr
tr
td width=173
div id=hh/div
div id=bb/div
div id=hhello/div
div id=aa/div
/td
td width=98/td
/tr
/tbody
/table
/BODY
/html
jquery.js
/*
* jQuery 1.2.3 - New Wave Javascript
*
* Copyright (c) 2008 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
* $Rev: 4663 $
*/
(function(){if(window.jQuery)var _jQuery=window.jQuery;var
jQuery=window.jQuery=function(selector,context){return new
jQuery.prototype.init(selector,context);};if(window.$)var _$=window.
$;window.$=jQuery;var quickExpr=/^[^]*((.|\s)+)[^]*$|^#(\w+)$/;var
isSimple=/^.[^:#\[\.]*
$/;jQuery.fn=jQuery.prototype={init:function(selector,context)
{selector=selector||document;if(selector.nodeType)
{this[0]=selector;this.length=1;return this;}else if(typeof
selector==string){var
match=quickExpr.exec(selector);if(match(match[1]||!context))
{if(match[1])selector=jQuery.clean([match[1]],context);else{var
elem=document.getElementById(match[3]);if(elem)if(elem.id!
=match[3])return
jQuery().find(selector);else{this[0]=elem;this.length=1;return
this;}else
selector=[];}}else
return new jQuery(context).find(selector);}else
if(jQuery.isFunction(selector))return new jQuery(document)
[jQuery.fn.ready?ready:load](selector);return
this.setArray(selector.constructor==Arrayselector||(selector.jquery||
selector.lengthselector!=window!selector.nodeTypeselector[0]!
=undefinedselector[0].nodeType)jQuery.makeArray(selector)||
[selector]);},jquery:1.2.3,size:function(){return
this.length;},length:0,get:function(num){return num==undefined?
jQuery.makeArray(this):this[num];},pushStack:function(elems){var
ret=jQuery(elems);ret.prevObject=this;return
ret;},setArray:function(elems)
{this.length=0;Array.prototype.push.apply(this,elems);return
this;},each:function(callback,args){return
jQuery.each(this,callback,args);},index:function(elem){var
ret=-1;this.each(function(i){if(this==elem)ret=i;});return
ret;},attr:function(name,value,type){var
options=name;if(name.constructor==String)if(value==undefined)return
this.lengthjQuery[type||attr](this[0],name)||
undefined;else{options={};options[name]=value;}return
this.each(function(i){for(name in options)jQuery.attr(type?
this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value)
{if((key=='width'||
key=='height')parseFloat(value)0)value=undefined;return
this.attr(key,value,curCSS);},text:function(text){if(typeof text!
=objecttext!=null)return
this.empty().append((this[0]this[0].ownerDocument||
document).createTextNode(text));var ret=;jQuery.each(text||
this,function(){jQuery.each(this.childNodes,function()
{if(this.nodeType!=8)ret+=this.nodeType!=1?
this.nodeValue:jQuery.fn.text([this]);});});return
ret;},wrapAll:function(html)
{if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function()
{var elem=this;while(elem.firstChild)elem=elem.firstChild;return