473,379 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Find and HTML Element

If I have an HTML element, say a <p> tag with and ID="Fred", how do I find
that element? I want to set the Style attribute to "hidden", how do I do
that?

Thanks!!!
Nov 18 '05 #1
3 1331
document.getElementById('Fred')

"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
If I have an HTML element, say a <p> tag with and ID="Fred", how do I find
that element? I want to set the Style attribute to "hidden", how do I do
that?

Thanks!!!

Nov 18 '05 #2
> If I have an HTML element, say a <p> tag with and ID="Fred", how do I find
that element? I want to set the Style attribute to "hidden", how do I do
that?


If this is to toggle items on/off on screen, then this is probably a job for
javascript.

If it's to toggle items on/off via a postback, then I'd just use
labels/placeholders to hold the content and set those visbible states in the
codebehind.

Otherwise, you can put a runat="server" in the P tag and access it that way.

-Darrel
Nov 18 '05 #3
I am using javascript to turn on and off an error message based on an edit
which is imposed in the javascript. But when the page comes back to the
server I am going to run the test again at the server and hence I want to
turn the message on if I detect and error.

OK, I place a "runat="server" and then access, but I'm still not sure what
the code would look like to change the visibility property and I am not sure
which class I should use for the <P> element. Is this equate to the
"HtmlContainerControl"? That has no "Attibutes" property. Maybe I should
use the plain "HtmlControl"?
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
1
by: Eshrath Ali Khan | last post by:
Hi, I have a requirement where I am transforming a XML into a html using an XSL. I need to create a object for the each and every occurrence of an element named "tgroup" in the xml. Also I need...
13
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
8
by: jklimek | last post by:
I have something like this: <table name="test" id="test"> <tr> <td><input type="button" onClick="showMeParentTableName();"></td> </tr> </table> How can I have my input button show me the...
1
by: Victor Hadianto | last post by:
Hi, I have a simple XSD for example like this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified">...
4
by: 28tommy | last post by:
Hi, I'm trying to find scripts in html source of a page retrieved from the web. I'm trying to use the following rule: match = re.compile('<script + src=+>') I'm testing it on a page that...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
2
by: cakebread | last post by:
I'm having problems parsing a file: <body>Hello world</body> </html>""") None The above works fine with the first element being a simple <html>, but not when I have all the xmlns's.
2
by: =?Utf-8?B?T2xkQnV0U3RpbGxMZWFybmluZw==?= | last post by:
How do you find an HTML control that is placed on an HTML page? I presume that you have to add the runat="server" to the HTML element..but then how do you find that element?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.