JavaScript - I'm A Newbie...be Gentle Help Needed Urgent Html Jscript
hi i am trying to populate a textarea with the selections
like checkboxes radiobuttons textbox combobox but i cant seem to do so. i am naive to the field of programing, and found a few code snippets to do so i tried but it did no good... help needed this is my code " <html> <head> <style type="text/css"> .minitext { font: normal 0.7em Arial, sans-serif; color: Black; } .disable { background-color: #CF110C; color: #fff; font-weight: bold; padding: 5px; } </style> <script language="Javascript" type="text/javascript"> function populateTextArea(){ var output = new Array(); var fieldID = 1; while (fieldObj = document.MyForm['iid'+fieldID]) { if (fieldObj.length) { for (var j=0; j<fieldObj.length; j++) { if (fieldObj[j].checked) { output[output.length] = fieldObj[j].value;} }//end of for } //end of if else { if (fieldObj.checked) { output[output.length] = fieldObj.value; } }//end of else fieldID++; }// end of while document.getElementById('targetarea').value = output.join(', '); //document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value ; } </script> </head> <body> <br> <br> <form name="MyForm" method="POST" action="#"> String 1: <input type="text" name="ip1" value=""><br> String 2: <input type="text" name="ip2" value=""><br> String 3: <input type="text" name="ip3" value=""><br><br> <input type="checkbox" name="iid1" id="pe_item2" value="Text string 1"> Text string <input type="checkbox" name="iid1" id="pe_item2" value="Text string 12"> Text string 1<br><br><br> <input type="radio" name="iid2" id="pe_item4" value="Text string 2">Text string 2 <input type="radio" name="iid2" id="pe_item6" value="Text string 3">Text string 3<br> <input type="radio" name="iid3" id="pe_item8" value="Text string 4">Text string 4 <input type="radio" name="iid3" id="pe_item10" value="Text string 5">Text string 5<br> <input type="radio" name="iid4" id="pe_item12" value="Text string 6">Text string 6 <input type="radio" name="iid4" id="pe_item14" value="Text string 7">Text string 7<br> <br> <br> <a href="#" onClick="document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value + populateTextArea();" >Populate</a><br> <br> <INPUT TYPE=BUTTON VALUE="Co" ONCLICK= populateTextArea(); > <br> <textarea id="targetarea" name ="targetarea" cols="50" rows="5"></textarea> </form> </body> </html> " help need this done urgently Similar TutorialsHi I'm trying to download the security image from this site (at the bottom): http://pacesalsa.promotionexpert.com...2/register.jsp However, every time one refreshes the image, the image changes (obviously). So, I'm trying to figure out how to download the current image on the page to a jpg or png (or any image file type). Could someone please tell me how to do this? Thanks. I have been trying for hours to do the following: - Change the background of a div by clicking a link from another div tag. - It also needs to change back when clicked again. I know there are alot of experienced coders out there and I'm eager to learn... help would be appreciated! I want to insert image instead of those empty boxes.......can someone help me please...... <script type="text/javascript"> document.write("<html><head><title>My PhotoCollage</title></head><body>"); function makeDiv() { var r = Math.floor(Math.random()*256); var g = Math.floor(Math.random()*256); var b = Math.floor(Math.random()*256); var wh = 25 + Math.floor(Math.random()*444); var lr = (Math.random()<.5) ? "top":"right"; var bw = 1 + Math.floor(Math.random()*12); var bs = (Math.random()<.5) ? " solid":"dotted"; var dc = (Math.random()<.5) ? "Dog" : "Cat"; var Img = Math.floor(Math.random()*256); document.write("<div style=\"float: "+lr+";"+ "width: "+wh+"px;"+ "height: "+wh+"px;"+ "border: rgb(" + g + "," + b + "," + r + ") "+bw+"px "+bs+";"+ "background-color: rgb(" + r + "," + g + "," + b + ");"+ "image: "\">"+dc+ "</div>"); } var i; var count = Math.floor(Math.random()*100) + 5; for (i=0; i<count; i++) makeDiv(); document.write("</body></html>"); </script> I tried to write the variable my_var into a text file but it only shows null after executing the code. Can anybody help pls?? Below is my code <html> <head> <script language="javascript"> var my_var function WriteToFile() { my_var = 123; document.write(<?php $file="file.txt"; $fh = fopen($file, 'w') or die("can't open file"); ?>; document.write(<?php $stringData = my_var ?>; document.write(<?php fwrite($fh, $stringData); ?>; document.write(<?php fclose($fh); ?>; } </script> </head> <body onLoad="WriteToFile();"> <p>Hello World</p> </body> </html> I need some help for University cousework that has been sent and I hope someone here can help. I need to create a cookie (easy enough) and then populate that cookie with a word that is selected when you click a certain image. Imagine you have image1.jpg and image2.jpg when a user selects image1.jpg the cookie needs to store image1 and load page2.html If the user selects image2, then page2.html still needs to load but store the word image2 in the cookie. On the next page, the cookie is loaded and the page needs to load the css file associated with that word example: image1 = firstcss.css image2 = secondcss.css Is this possible? Thank you for all your help Friends i'm in a dire situation only have wednesday to submit ..so heres the problem....i have a course work assigment where i have to hardwire Hardware items and their item codes description and prices and ask the user to input their name address the itemCode and quantity nad then creat an invoice which looks like this HARDWARE ITEMS CODE DESCRIPTION UNIT PRICE K16 Wood screws, brass, 20mm, pack of 50 $ 7.75 D24 Wood glue, clear, 1 litre $ 5.50 M93 Sandpaper, medium grade, 100 sheets $10.25 M94 Sandpaper, fine grade, 100 sheets $14.75 PLACE YOUR ORDER! NAME: Bill Silic ADDRESS-1: Apt 23 ADDRESS-2: Building 8 ADDRESS-3: Winchester POST CODE: 89763 ENTER CODE (XX to Stop): CODE: D24 QUANTITY: 2 CODE: K16 QUANTITY: 1 CODE:XX INVOICE FOR ORDER Bill Silic Apt 23 Building 8 Winchester POST CODE: 89763 D24 Wood glue, clear, 1 litre 2 @ $ 5.50 $ 11.00 K16 Wood screws, brass, 20mm, pack of 50 1 @ $ 7.75 $ 7.75 TOTAL: $ 18.75 Shipping: 2 items @ 1.00 2.00 TOTAL INCL. SHIPPING: 20.75 VAT at 20% 4.15 TOTAL TO PAY: 24.90 I HAVE ALREADY COMPLETED THIS BY MYSELF AND GOT IT WORKING WITH NO PROBLEM ..But my problem is that the teacher wants us to TEST FOR NULL ENTRY meaning if the user enters the wrong Itemcode or no ItemCode at all and give an sensible output for that case ..... she wants us to put it in a method after main and then call it in main using a do while loop so my method looks something like this Code: public static boolean isSomethingCorrect(String itemCode){ if(itemCode.equals("")||itemCode.equals(null)){ System.out.println("A sensible output"); return true; }//close if return false; } } // and i have to implement it where i ask the user for input using a Do while loop in this area Code: //a do while loop to test null code entry do{ System.out.println("Please select a code from the list"); String itemCode= br.readLine(); System.out.println("Please enter quantity of items " +itemCode); String itemQuantity= br.readLine(); int quantity= Integer.parseInt(itemQuantity); // I Will be forever grateful for any help on this program because i have tryed for hours upon hours and i just cant get it and i need to submit the day after tomorrow Hi everyone, im no expert in coding but i manage to get this bit of code together using some free source stuff and put in the links to my images ect, the problem now is i need each picture to be different sizes and each one to have a clickable link but i am completely stumped heres the code Code: <html> <head> <script type="text/javascript"> <!-- var image1=new Image() image1.src="http://gohelp.org.uk/wp-content/uploads/2011/05/Charity-Rallies-World.png" var image2=new Image() image2.src="http://gohelp.org.uk/wp-content/uploads/2011/05/ROTW-logo.jpg" var image3=new Image() image3.src="http://gohelp.org.uk/wp-content/uploads/2011/05/Mongolia-Charity-Rally-Logo-Transparent.png" //--> </script> </head> <body> <center><img src="http://gohelp.org.uk/wp-content/uploads/2011/05/Charity-Rallies-World.png" name="slide" width="150" height="68" /></center> <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src") if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> </body> </html> Hi I have been trying to create a form using Django for a very long time but have not been able to get it to look the way I want. Someone suggested to me that I should use Javascript (Jquery) to do this. Here's what I want to do. For the form I want, there are certain statuses at the bottom, like "Done", "Incomplete" and etc. When the form is filled in, the person will click on one of these statuses. What I want this button to do is to save the page/form and also to generate a few new links relating to the status selected. For example, if the person selects "Done" this should save the form and generate two new buttons. One that says "Close" which would take you to the home page, and one that says "Continue" which would take you to the next form. My problem is that I'm new to Django and have no experience with Javascript. So if anyone could help or give me hints that would be greatly appreciated. hi guys, I have built an rss ripper, the point is to bypass technology restrictions when exporting from sharepoint to excel 2003. My problem i'm using the code below to output data in a nice html tabular format, however when trying to import into excel via web query i get no data returned, i think this is as it isn't real html, i've made a few alterations and am now getting account pulled back - how do i get it to pull all the data ? code is as follows, also i've put a link at the bottom to w3 so you can get a good idea of the issue: <%@ Language=VBScript %> <html> <head> <script type="text/javascript" src="loadxmldoc.js"></script> </head> <body> <script type="text/javascript"> function loadXMLDoc() { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET","my file path",false); xhttp.send(); return xhttp.responseXML; } xmlDoc=loadXMLDoc(""); uppernum=(xmlDoc.getElementsByTagName( "title" ).length ); accstartnum=2 detstartnum=1 qlow = 0 qhi = 12 //document.write("<table border=1") </script><table border = 1><tr><script> z=xmlDoc.getElementsByTagName("description")[detstartnum] </script><td>Account</td><script> y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 0 while (array_pos < data_array.length) { if (array_pos%2) { document.write ("<td>" + data_array[array_pos] + "</td>"); array_pos+=1; } else { array_pos+=1; } } document.write("</tr>") while (accstartnum < uppernum) { document.write("<tr>") x=xmlDoc.getElementsByTagName("title")[accstartnum] y=x.childNodes[0]; acc = (y.nodeValue); z=xmlDoc.getElementsByTagName("description")[detstartnum] y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 1 document.write("<td>" + acc + "</td>") while (array_pos < data_array.length) { if (array_pos%2) { array_pos+=1; } else { document.write ("<td>" + data_array[array_pos] + "</td>") array_pos+=1; } } accstartnum+=1; detstartnum+=1; document.write("</tr>") } </script></table><script> //url = document.location.href; //urll = url.split("?"); //if (urll.length == 0) // { // document.self.location.replace("http://midevsso.gcf-uk.gcf.capital.ge.com/Development/rssreader.asp?reload=1"); // } </script> </body> </html> if you have excel 2003 you can get an idea of the issue by trying to import the table he http://www.w3schools.com/XML/tryit.a..._display_table Hi Guys, Im in need of some help with regards to forms. I am looking to build as basic as possible, a form that has 3 select dropdowns that have predetermined options. The user will select the first option and based on that option the second will populate and based on that, the third one will give the last option. Now, when the last one is selected, i need a div or a paragraph displaying information to be displayed. So here's the framework. Option 1 = fruit or vegitables of which fruit is selected is selected by the user Option 2 = Apples, Grapes, and pears of which apples is then selected Option 3 = Red, Green and Yellow of which Green is selected. Once green is selected, I need a description about the green aple to be displayed. Can anyone help me out on this? I am not sure where to begin and my boss is adament it must be done like yesterday. Ay help will be appreciated. Thanks. I have the following code to load iframes but I don't know how to make it load the "LT-video_default.html" when it first loads the page. If I choose one of the options and then go back and choose the "Choose a manufacturer" option it loads the desired page. Here is the code. Code: <script language="JavaScript"> <!-- Begin function leapto(form) { var myindex=form.dest.selectedIndex parent.CONTENT.location.href=(form.dest.options[myindex].value); // You can output to ANY frame using: parent.[framename].location.href } // End --> </script> <div id="videoWrapper"> <form name="labtv"> <select name="dest" size="1" onchange="leapto(this.form)"> <option selected="selected" value="LT-video_default.html">Choose A Manufacturer </option><option value="LT-video_nanodrop.html">NanoDrop </option><option value="LT-video_bioflux.html">Bioflux </option><option value="LT-video_genvault.html">GenVault </option><option value="LT-video_hamilton.html">Hamilton </option></select> </form> <iframe name="CONTENT" frameborder="no" height="400" scrolling="no" width="650"> </iframe> </div> Folks I am a newbie to JavaScript. I am basically java/j2ee developer . I want to learn javascript and Ajax . So please let me know what is the latest version of JavaScript , also let me know what book I have to buy ( I mean for the newbie ) Please help me . Thanks in Advance Hey Coding Forum, Hey as you probably know iam new here as i probably haven't even posted this in the correct place but i have a real problem with my JavaScript and i can't get it to do what i would like. I have to write a code to show a new array to represent the third row of a table (var myarray value of which are "60","80","187","180","114" , and creating an array of the required length. Which i have done. (i Think ) I now need to write the remainder of the JavaScript needed to calculate the average height of the objects and write it out in the browser window. It need to write average height 17.2 cm. I have included my script below and but i am not understanding how to work out the average, i believe i need to add another 'for loop' but i can't get it to work correctly. (i might be being completely stupid) If anyone would be able to help it would be GREATLY appreciated. Thanks for all help. <HTML> <HEAD> <TITLE> Test Experiment </TITLE> <SCRIPT LANGUAGE = "JavaScript"> var height = [15,16,17,18,19]; var number = [4,5,11,10,6]; var myarray = new Array(5) var myarray = ["60","80","187","180","114"] ; var values = [60, 80, 187, 180, 114]; var total = 0; for ( var i = 0; i < values.length; ++i ) { total += values[i]; } var myarray = total + values.length; document.write('average height of the object is ' +myarray + '<br>'); </SCRIPT> </HEAD> <BODY> </BODY> </HTML> I'm trying to render 14 same sized images on a webpage using a Javascript, I've used in the past, but now can't seem to get it to work. Getting a Syntax Error. On Page http://www.newenglandonline.net/index.fix.html The ERROR appears to be on the following; line 270: var imageDir = ; [CODE] <script type="text/javascript"> (function() { var rotator = document.getElementById(rotator); var imageDir = ; var delayInSeconds = 3; var images = [Cannon_top.jpg,Mount-Washington-Summer.jpg,Mount-Washington-Winter.jpg,Boston_Charles.jpg,Boston_Harbor.jpg,Boston_Harbor_night.jpg,Zakim Bridge.jpg,Edgartown.jpg,GayHeadLighthouse.jpg,HighlandLight.jpg,Newport.jpg,Bridgeport.jpg,Eastpoin tLight.jpg]; var num = 0; var changeImage = function() { var len = images.length; rotator.src = imageDir + images[num++]; if (num == len) { num = 0; } }; setInterval(changeImage, delayInSeconds * 1000); })(); </script> [CODE] Any help or insight will be greatly appreciated. Thanks in advance. Not new to programming but I am to JQuery (and j/script in general). I need to query a mysql database to return a small amount of data (some text) based on a user code (e.g. MrABC). I could use an iFrame and PHP but if the internet connection is down I do not want error messages displayed - the intended audience have limited cognitive capabilities and will not cope with ERROR 404 etc... Essentially I need to be able to create a function that can be called with a parameter of the usercode and which returns the text from the lookup. What I put in the function is a complete mystery to me ... i am having a simple login system, but i need some help i want to assign an if else statement my code is this : what i need is if i login to sales if navigates to sales page, if other then go to other page pls help me It is very important for me Thanks is advance Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ENTER USER NAME ENTER PASSWORD</title> <style type="text/css"> .style1 { text-align: center; } </style> </head> <body style="background-color: #AFC8C7"> <script type = "text/javascript"> // Note: Like all Javascript password scripts, this is hopelessly insecure as the user can see //the valid usernames/passwords and the redirect url simply with View Source. // And the user can obtain another three tries simply by refreshing the page. //So do not use for anything serious! var count = 2; function validate() { var un = document.myform.username.value; var pw = document.myform.pword.value; var valid = false; var unArray = ["HR", "Admin", "IT", "Sales"]; // as many as you like - no comma after final entry var pwArray = ["hr123", "admin123", "it123", "sales123"]; // the corresponding passwords; for (var i=0; i <unArray.length; i++) { if ((un == unArray[i]) && (pw == pwArray[i])) { valid = true; break; } } if (valid) { alert ("Login was successful"); window.location = "index.html"; return false; } var t = " tries"; if (count == 1) {t = " try"} if (count >= 1) { alert ("Invalid username and/or password. You have " + count + t + " left."); document.myform.username.value = ""; document.myform.pword.value = ""; setTimeout("document.myform.username.focus()", 25); setTimeout("document.myform.username.select()", 25); count --; } else { alert ("Still incorrect! You have no more tries left!"); document.myform.username.value = "No more tries allowed!"; document.myform.pword.value = ""; document.myform.username.disabled = true; document.myform.pword.disabled = true; return false; } } </script> <form name = "myform"> <p> </p> <p> </p> <p> </p> <p class="style1">User Name: <input type="text" name="username" style="width: 131px"> </p> <p class="style1"> Password: &nbs p; <input type="password" name="pword" style="width: 131px"> </p> <p class="style1"> & nbsp;   ; <input type="button" value="Log In" name="Submit" onclick= "validate()" style="width: 96px"> </p> </form> <div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 136px; top: 252px" id="layer1"> </div> <p> </p> </body> </html> Hi I am trying to write a simple script for html form validation before going on to write a more complicated script for the full form which will eventually be on the web page. However, I cannot tell if the javascript is executing or not, as no alert messages come up. If I fill in the form with blanks (which is what the function checkform() checks for) then it should display an alert on submission and return false. Otherwise, returns true. I need to get this licked before going on to the more complex coding, but I really can't see why this doesn't appear to work. I'd be most grateful if some kind soul out there could have a look at it for me.... Links below. Thank you in anticipation! http://www.kellyresources.co.uk/onli...ment_test.html http://www.kellyresources.co.uk/checkform.js hey guys, i know this really hot girl and need to make her think we are right for eachother, to do this i need to 'tweak' a lovetest. i know the love test's answer depends on the number of the letters L,O,V,E,Y,O,U but i need an if function that adds up both name boxes and adds to 100%. here is code: // Made by ADAM - roflmao456 var test = ''; function checkLove(){ var l1 = test.GetControlText('love1'); var l2 = test.GetControlText('love2'); first = l1.toUpperCase(); firstlength = l1.length; second = l2.toUpperCase(); secondlength = l2.length; var LoveCount=0; for (Count=0; Count < firstlength; Count++) { letter1=first.substring(Count,Count+1); if (letter1=='L') LoveCount+=2; if (letter1=='O') LoveCount+=2; if (letter1=='V') LoveCount+=2; if (letter1=='E') LoveCount+=2; if (letter1=='Y') LoveCount+=3; if (letter1=='O') LoveCount+=1; if (letter1=='U') LoveCount+=3; } for (Count=0; Count < secondlength; Count++) { letter2=second.substring(Count,Count+1); if (letter2=='L') LoveCount+=2; if (letter2=='O') LoveCount+=2; if (letter2=='V') LoveCount+=2; if (letter2=='E') LoveCount+=2; if (letter2=='Y') LoveCount+=3; if (letter2=='O') LoveCount+=1; if (letter2=='U') LoveCount+=3; } amount=0; if (LoveCount> 0) amount= 5-((firstlength+secondlength)/2) if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2) if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2) if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2) if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2) if (LoveCount>10) amount= 50-((firstlength+secondlength)/2) if (LoveCount>12) amount= 60-((firstlength+secondlength)/2) if (LoveCount>14) amount= 70-((firstlength+secondlength)/2) if (LoveCount>16) amount= 80-((firstlength+secondlength)/2) if (LoveCount>18) amount= 90-((firstlength+secondlength)/2) if (LoveCount>20) amount=100-((firstlength+secondlength)/2) if (LoveCount>22) amount=110-((firstlength+secondlength)/2) if (firstlength==0 || secondlength==0) amount= "Err"; if (amount < 0) amount= 0; if (amount >99) amount=99; test.SetControlText('loveOutput',amount+"%"); return "[c=12]"+test.GetControlText('love1')+"[/c] + [c=29]"+test.GetControlText('love2')+"[/c] = [c=3]"+amount+"[/c]%"; } function OnGetScriptMenu(){ var ScriptMenu = "<ScriptMenu>"; ScriptMenu += "<MenuEntry Id='lovetest'>"; ScriptMenu += "Love Test"; ScriptMenu += "</MenuEntry>"; ScriptMenu += "</ScriptMenu>"; return ScriptMenu; } function OnEvent_MenuClicked(sMenuId){ if(sMenuId == "lovetest") {test = MsgPlus.CreateWnd("windows.xml","tester");} } function sendResult(){ for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()){ if(test.GetControlText('love1')){ if(test.GetControlText('love2')){ e.item().SendMessage(checkLove()); } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 2."); } } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 1.") }}} function OntesterEvent_CtrlClicked(PlusWnd, ControlId){ if(ControlId == "startTest") {checkLove();} else if(ControlId == "sendResults") {sendResult();} else if(ControlId == "BtnClose") {PlusWnd.Close(1);} } END OF CODE please reply with a fixed script with a line like %=50+50 or something so the output is 100%. thanks Please see the below code. Is it possible for me to type in an order date in the browser & in the due date field, have it automatically populate a date 7 days greater than the date typed in the order date field? If so how? I have read I will probably need javascript to do this but have no clue where to start. Thanks for any help provided! <html> <head> <title> Update Database </title> </head> <body> <form method="post" action="add.php"> <b>First Name:</b> <br /> <input type="text" name="customer_fname" size="35" /><br /> <b>Last Name:</b> <br /> <input type="text" name="customer_lname" size="35" /><br /> <b>Location:</b> <br /> <input type="text" name="location" size="35" /><br /> <b>Order Date:</b> <br /> <input type="text" name="order_date" size="35" /><br /> <b>Due Date:</b> <br /> <input type="text" name="due_date" size="35" /><br /> <input type="submit" value="Submit" /> </form> </body> </html> I'm a newbie...please! html lists making javascript array I need help with a HTML UL I have ul inside ul but all I want to get when I select a certain list is the children of that list but remove the ul inside that list so they dont show at all http://pastebin.com/m98deaff any help would be great , current selecting code is http://pastebin.com/m6f4b886f Code: <div class="demo" id="demo_1"> <ul> <li id="1" class="open"><a id="1" href="#"><ins> </ins>Root node 1</a> <ul> <li id="2"><a id="2" href="#"><ins> </ins>Child node 1</a></li> <li id="3"><a id="3" href="#"><ins> </ins>Child node 2</a></li> <li id="4"><a id="4" href="#"><ins> </ins>Some other child node with longer text</a></li> <li id="6"><a id="6" href="#"><ins> </ins>Root node 222</a> //SHOUL NOT BE IN MY ARRAY <ul> <li id="7"><a id="7" href="#"><ins> </ins>Child node 222a</a></li> <li id="8"><a id="8" href="#"><ins> </ins>Child node 222b</a></li> <li id="9"><a id="9" href="#"><ins> </ins>Some other child node with longer text 222</a></li> </ul> //END OF UL ELEMENT N OT NEEDED THERE COULD BE more than 1 </li> </ul> </li> <li id="5"><a id="5" href="#"><ins> </ins>Root node 2</a></li> </ul> |