remove p tag from DOM tree


This should be a simple one, and yet I need help to solve the problem:
I need to remove the element with the class "goup" on it from the DOM tree
with javascript (eventually with prototype, but no other library).
I don't only want to hide that paragraph, but remove it entirely from the DOM tree.

My solution to use getElementsByClassName does not work.

function hidegoup() { var goup= document.getElementsByTagName("p") .getElementsByClassName("goup"); goup.style.display = 'none'; goup.removeChild(); }

THE HTML:

To the top of the page
Posted On: Monday 26th of November 2012 10:07:01 PM Total Views:  177
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




How to remove Internet Explorer sound from webpages?

. I'm having a problem with MSIE6 & 7 browsers. I want to remove or disable the sound("click") than browser produce when trying to open a web page or link in web page. Is this possible Please help, is's a big problem for me. Have a nice day.
VIEWS ON THIS POST

89

Posted on:

Saturday 10th November 2012
View Replies!

remove or add a value

Hi I have 2 selectionlists. The first one has 2 countries, England and Spain. The second on has cities for these 2 countries. These cities are: London, Barcelona, Madrid and Malaga. Now what I want is, if a user selects England in the first selection list, then the only option he has in the second selection list, is to choose London, since it won't make sense that he can choose cities that don't belong to England. How can I achieve this Here is the code I have so far, which doesn't work function validateChoice(){ var temp = document.getElementById("here"); if(temp.value == "Spain"){ document.getElementById("lon").value = null; //I want to remove London, since it is not in Spain } } Here is the corresponding html code Spain England Madrid Barcelona Malaga London
VIEWS ON THIS POST

89

Posted on:

Sunday 11th November 2012
View Replies!

To remove the empty space from the array

I have the following code which will split the given input based on the comma(,) and will store each value in separate address of the same array. function pica() { var NumberString =("100,200,,300,,500"); var scripts = NumberString.split(","); for (i=0;i
VIEWS ON THIS POST

94

Posted on:

Monday 12th November 2012
View Replies!

Javascript code works only when CSS file is removed

Hi. I have a javascript code inserted before closing tag that is meant to change the color of a table row when the mouse is placed over it. It works only when I remove the css file. Please advise what is the problem, I need them working together. The Javascript code is as follows:
VIEWS ON THIS POST

157

Posted on:

Friday 16th November 2012
View Replies!

Add and remove styles to links, jquery

I dont have the best knowledge to js ot Jquery, so here goes: I have some links, that returns false when clicked on. But still i want to add a class to the element being clicked, because it is kind of a tab thingie in a div, so for usability.. At first when the page loads, i am doing something i think is a hopeless way Because i want to add styles to the first tab, as it is showing info on page load: window.onload = aktiv_sub; function aktiv_sub() { document.getElementById('sub_id_1').style.color='#FFF'; document.getElementById('sub_id_1').style.height='35px'; document.getElementById('sub_id_1').style.backgroundColor='#900'; document.getElementById('sub_id_4').style.color='#FFF'; document.getElementById('sub_id_4').style.height='35px'; document.getElementById('sub_id_4').style.backgroundColor='#096'; document.getElementById('sub_id_7').style.color='#FFF'; document.getElementById('sub_id_7').style.height='35px'; document.getElementById('sub_id_7').style.backgroundColor='#069'; document.getElementById('sub_id_10').style.color='#FFF'; document.getElementById('sub_id_10').style.height='35px'; document.getElementById('sub_id_10').style.backgroundColor='#664798'; } This leaves me with a problem, when the other tabs are clicked: I can add styles, but they do not get removed from the previously clicked link: $(function() { $(".sub").click(function() { $(this).css("color", "white"); $(this).css("height", "35px"); $(this).css("background", "#990000"); // And then remove the styles, or write other styles to the links that are not active: }); }); // I know i am hopeless // :-) How can i turn this into a simple jquery function, that does all the magic\t Klemme
VIEWS ON THIS POST

159

Posted on:

Friday 16th November 2012
View Replies!

add/remove new row to a table

I am still VERY new to JavaScript, so I will do the best at explaining what I am trying to do here... I have a database table where I store a bunch of invoices. I am now trying to make a front end to run queries. I don't know how to make it so i can keep adding AND/OR statements to my query as need be. Also, I need a way to eliminate the FIRST AND/OR drop down list because obviously your first query statement will not start with an AND or OR. Here is my basic html code: Invoice Query AND OR Invoice Number Invoice Date Vendor Purpose Amount = > >=
VIEWS ON THIS POST

109

Posted on:

Friday 16th November 2012
View Replies!

How to remove underline and blue color from text in?

I have hyperlinked texts and i want to remove the underline and blue color also. I removed underline but not the blue color i want the font to be in black\t Here is the code:
VIEWS ON THIS POST

262

Posted on:

Friday 16th November 2012
View Replies!

removeChild() working fine in FF but not in IE

, I have the situation where I want to clear out the whole tree of nodes given a parent node. I get this to work in Firefox (where, actually, it's not necessary to traverse the whole tree) but in IE it doesn't work at all. Here's the code: function removeChildren(node) { while (node.hasChildNodes()) { removeChildren(node.firstChild); node.removeChild(node.firstChild); } } while (holder.hasChildNodes()) { removeChildren(holder.firstChild); holder.removeChild(holder.firstChild); } Any ideas on why this is
VIEWS ON THIS POST

112

Posted on:

Wednesday 21st November 2012
View Replies!

remove a list item

I would like to know how can i remove a selected item from an ordered list which was dynamicaly created\t Thanking you in advance!!
VIEWS ON THIS POST

309

Posted on:

Thursday 22nd November 2012
View Replies!

.click remove row (not working)

I am trying to archive a database entry using .post, but I am getting this error: "Uncaught SyntaxError: Unexpected token (" I am defintely still in the learning phase of jQuery, so any help is appreciated! //Archive Table Row function archiveEntry(id){ function(){ if (confirm("Archive Fill #"+id+"")) { $.post('/elevator/scripts/php-inc/archive.php', {id: +id, ajax: 'true' }, function(){ $(".row_"+id).fadeOut(); }); } else { return false; } } }
VIEWS ON THIS POST

169

Posted on:

Saturday 24th November 2012
View Replies!

Add / remove table row. javascript

Hi , Im looking for a simple function to add / remove a table row for my website. I have searched high and low for a script that does it... but no dice... can anyone shoot me a link or post a snippet of code that would enable me to create an additional table row. cheers
VIEWS ON THIS POST

182

Posted on:

Saturday 24th November 2012
View Replies!

Jquery $("#tabs").tabs( "remove"?

I have this code in the general js file. $("#tabs").tabs({ collapsible: true, cache: true, ajaxOptions: { error: function(xhr, status, index, anchor) { $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible. If this wouldn't be a demo."); } } }); And $("#tabs").tabs( "remove" , 2 ); In the TABs (see Picture): INDEX "0" (Display Categories) INDEX "1" (Add Category) I use "cache" so that I don't loose the search results of INDEX "0" when the user comes back to the TAB case he when to another TAB. In INDEX "0" if user click "UPDATE" icon TAB INDEX "2" (EDIT) is created. But I need to get TAB (INDEX 2) closed when the user leaves that tab, and with CACHE: TRUE the $("#tabs").tabs( "remove" , 2 ); doesnt work. How can I put something like. if EXIT TAB 2 then REMOVE.... without the CACHE interfering Can anyone help me [IMG]http://www.drosendo.com/tabsremove.jpg[/IMG]
VIEWS ON THIS POST

97

Posted on:

Saturday 24th November 2012
View Replies!

To remove li using JQuery

In my application I have s and I am using Jquery to remove a particular The code I am using is $(".close").click( function() { $(this).parent().remove()// Links with the class "close" will close parent return false; } ); Using this I am successfully able to remove a li but after its being removed...The below it moves in place of the deleted one and is creating a white space. How can i remove that white space
VIEWS ON THIS POST

102

Posted on:

Saturday 24th November 2012
View Replies!

onClick remove onMouseOut

I'm no great shakes at Javascript... I do all my stuff through Dreamweaver. My situation is fairly simple. I have image "A" that has its own mouseover and mouseout (to change it back to what it was). BUT I am having difficulties figuring out how to get the mouseOVER image to stay on when the image is clicked. This is further complicated because the image already has an onClick to change image "B". I can post the code I have in Dreamweaver as of right now if that would help. I figure I need another onClick to somehow remove the onMouseOut. Or something, ha ha I don't know.
VIEWS ON THIS POST

114

Posted on:

Saturday 24th November 2012
View Replies!

Regex to remove 'Illegal Characters'

Try the following character class: var illegalChars = /[\u0021-\u002f\u003a-\u0040\u005b-\u005e\u0060\u007b-\u007e]/g; // Don't allow any of these Javascript supports specifying unicode characters by hexadecimal expressions like \u0060 and ranges like \u007b-\u007e . There is a fun website at http://hamstersoup.com/javascript/regexp_character_class_tester.html that gives you the unicode expressions for any character class you specify.
VIEWS ON THIS POST

102

Posted on:

Saturday 24th November 2012
View Replies!

Autocompelete textbox on add/remove row

the more i deep to javascript more i got confused..!! . . i have put a autocomplete texbox in a row.. which have two more buttons Add/Remove..!! . . With add u can append clone row under original row... and withy delete u can delete the row..!!!! . . Problems when i add new row... which make clone of original row..!! which means that Id of autocomplete also get cloned...!!!! . . Please help me out..!!! :( my javascript code..!! function add(oRow) { oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1)); var inpR = oRow.getElementsByTagName('input'); var inpN = oRow.nextSibling.getElementsByTagName('input'); inpR[0].id = 'month_' + parseInt(oRow.rowIndex+2); iteration = parseInt(oRow.rowIndex+2); for(i=0;i
VIEWS ON THIS POST

232

Posted on:

Saturday 24th November 2012
View Replies!

want to remove href="#" from JavaScript?

Hi I have an Image Gallery on my site. When a user click on thumbnail image, a JavaScript function will load/change image on the imageView area. Here is the JS function : function changeimage(img_name,img_src) { document[img_name].src=img_src; } Here is the ImageView area code : Here is the link code : link link link Now come to my problem : I wan to remove HREF="#" from the link code, because when anyone click on any link, the goes to top of page, and my Image Gallery is at center position of page. Is there any way to remove the HREF="#" Or disable the page scrool Help me please Thank you
VIEWS ON THIS POST

129

Posted on:

Saturday 24th November 2012
View Replies!

Add remove rows javascript problem....

Hi , I currently have this script on my page that allows users to add and remove rows in the page. I have a another script that calculates a value on the dynamically generated elements and static ones too. my problem is, I cant figure out a way to pass in a value for the inputs variable and have it as the base for the row generation... My question is... how do i pass in a value for the function to begin its creation of the rows.. as i have multiple tables with different IDs scattered through my page... any help greatly appreciated. ta var inputs = 4 ; function addContact(AreaName,AttName1,AttName2) { var table = document.getElementById(AreaName); var tr = document.createElement('TR'); var td1 = document.createElement('TD'); td1.setAttribute("width","250"); var td2 = document.createElement('TD'); td2.setAttribute("width","110"); td2.setAttribute("align","center"); var td3 = document.createElement('TD'); td2.setAttribute("width","110"); td3.setAttribute("align","center"); var td4 = document.createElement('TD'); var inp1 = document.createElement('INPUT'); var inp2 = document.createElement('INPUT'); var inp3 = document.createElement('INPUT'); if(inputs>=0) { var img = document.createElement('IMG'); img.setAttribute('src', 'images/p6_delete.gif'); img.onclick = function(){ removeContact(tr); } // var img2 = document.createElement('IMG'); // img2.setAttribute('src', 'images/other.gif'); td1.appendChild(img); // td1.appendChild(img2); var img3 = document.createElement('IMG'); img3.setAttribute('src', 'images/percent.gif'); img3.setAttribute('height','13'); img3.setAttribute('width','13'); td2.appendChild(img3); var img4 = document.createElement('IMG'); img4.setAttribute('src', 'images/dollar.gif'); img4.setAttribute('height','13'); img4.setAttribute('width','13'); td3.appendChild(img4); } inp1.setAttribute("Name", AttName1 + inputs); inp1.setAttribute("class","required"); inp1.setAttribute("id", AttName1 + inputs); inp1.setAttribute("size","2"); inp1.setAttribute("style","width:35px;"); inp2.setAttribute("Name", AttName2 + inputs); inp2.setAttribute("class","required"); inp2.setAttribute("id", AttName2 + inputs); inp2.setAttribute("size","2"); inp2.setAttribute("style","width:40px;"); inp3.setAttribute("Name","Other" + AttName2 + inputs); inp3.setAttribute("class","required"); inp3.setAttribute("id", "Other" + AttName2 + inputs); inp3.setAttribute("style","width:170px;"); inp3.setAttribute("title","title for the element"); table.appendChild(tr); tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td3); td1.appendChild(inp3); td2.appendChild(inp2); td3.appendChild(inp1); inputs++; } function removeContact(tr) { tr.parentNode.removeChild(tr); }
VIEWS ON THIS POST

144

Posted on:

Saturday 24th November 2012
View Replies!

Multiple select from Select tag to remove text

I have the code , which add the data from input filed to list-box.Now am able to remove individual input's. I want to have option multiple select to remove the data from list box . Select list: Add an option: How can I do this .... Please Help Thank You Pervez
VIEWS ON THIS POST

136

Posted on:

Sunday 25th November 2012
View Replies!

I need function 2 remove spaces if more than one

hello every one sorry if my activity not very well at last few days :icon_rolleyes: I need function 2 remove spaces if more than one and to merge lines into one line like this we still here where are you into we still here where are you
VIEWS ON THIS POST

109

Posted on:

Sunday 25th November 2012
View Replies!