How can I check for a specific HTML tag or Text and remove it when the page loads

T

techy techno

hiii

I wanted to know how can I check for a specific HTML tag or user defined
TEXT and delete it when the page loads

Whenver the IE loads the page my company add its COMPANY NAME in my
office on any page so what I want to do is to check for my company name
b4 the page loads and remove the company name and then load the page.

I want to do this in JS


thanks
 
R

Randy Webb

techy said:
I wanted to know how can I check for a specific HTML tag or user defined
TEXT and delete it when the page loads
Whenver the IE loads the page my company add its COMPANY NAME in my
office on any page so what I want to do is to check for my company name
b4 the page loads and remove the company name and then load the page.

Sounds more like you want to remove an Ad Banner from a site.
I want to do this in JS

And if JS is disabled?
 
F

Fabian

techy techno hu kiteb:
hiii

I wanted to know how can I check for a specific HTML tag or user
defined TEXT and delete it when the page loads

this sounds like a job for proxomitron. Google for it. Of course, since
you appear to be using a company machine, I'm not sure whetehr you'd
have permission to install any programs.
Whenver the IE loads the page my company add its COMPANY NAME in my
office on any page so what I want to do is to check for my company
name b4 the page loads and remove the company name and then load the
page.

If you are using a company machine, I think the company has the right to
impose whatever banners it sees fit. Is there a particular reason you
don't want these to appear?

I want to do this in JS

I don't think you can. I could be wrong of course.


--
 
T

techy techno

ITs ok

I just need the JS for hiding the TEXT

ITs not a banner its just a <h1> link to their site and If the js is
disabled then thats my hardluck :

so please can you give me the required JS.
thanks
 
M

Michael Winter

I just need the JS for hiding the TEXT

ITs not a banner its just a <h1> link to their site and If the js is
disabled then thats my hardluck :

so please can you give me the required JS.

Use CSS instead. It has more chance of being supported, too.

If the inserted HTML has a specific pattern, you can match that with CSS
selectors. For example:

<style type="text/css">
h1 a {
display: none;
}
</style>
</head>

<body>
...
<h1><a href="...">The advert text</a></h1>

The CSS rule above will cause all links within a H1 element to be hidden.
They'll still exist in the page, but the user won't see them. Of course,
this means that you cannot use a similar sequence yourself. However, you
needed to, the above example could be modified to:

<style type="text/css">
h1 a {
display: none;
}
h1.showThis a {
display: inline;
}
</style>
</head>

<body>
...
<h1><a href="...">The advert text</a></h1>
...
<h1 class="showThis"><a href="...">My own link</a></h1>

The use of a more specific selector, acheived through the use of a class,
takes precedence, so the second link is displayed, whilst the first is
hidden.

If this is to hide banner images or text inserted by a host, be warned
that hiding that content probably violates the Terms and Conditions of
that site and can lead to the termination of your account.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top