Create a new anchor tag and set its innerHTML

J

jbonifacejr

I would like to be able to create HTML anchor tags, set their
innerHTML values, and be able to click on them later in a process. For
example, I want to set the innerHTML values for three links. When the
first page loads, I want to click the first link, Link1, then wait for
page 2 to load, click Link2, etc.

I am using the mshtml and have the following lines...
mshtml.HTMLAnchorElement lnkYourAcctOrders;
mshtml.HTMLAnchorElementClass lnkYourAcctShipAddy;
mshtml.HTMLAnchorElementClass lnkYourAcctPmtInfo;

When I try to set the values I get an error telling me the objects
have not been instantiated, so I added the following lines before
trying to set the innerHTML...
lnkYourAcctOrders = new mshtml.HTMLAnchorElement();
lnkYourAcctShipAddy = new mshtml.HTMLAnchorElementClass();
lnkYourAcctPmtInfo = new mshtml.HTMLAnchorElementClass();

I realize that I have two different things above, the
mshtml.HTMLAnchorElement and the mshtml.HTMLAnchorElementClass. I have
this because I was trying to make either one work. I couldn't.

I know that I could load the page, and then put all the links in a
collection, and then click on the one that has an innerHTML matching
what I want. I was hoping to avoid that and simply be able to click on
the link I build, if it exists on the page.

Does anyone know how I would go about this?

Thanks in advance for your help.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Mon, 04 Feb 2008 19:18:54
GMT jbonifacejr scribed:
I would like to be able to create HTML anchor tags, set their
innerHTML values, and be able to click on them later in a process. For
example, I want to set the innerHTML values for three links. When the
first page loads, I want to click the first link, Link1, then wait for
page 2 to load, click Link2, etc.

I am using the mshtml and have the following lines...

What's "mshtml"?
mshtml.HTMLAnchorElement lnkYourAcctOrders;
mshtml.HTMLAnchorElementClass lnkYourAcctShipAddy;
mshtml.HTMLAnchorElementClass lnkYourAcctPmtInfo;

When I try to set the values I get an error telling me the objects
have not been instantiated, so I added the following lines before
trying to set the innerHTML...
lnkYourAcctOrders = new mshtml.HTMLAnchorElement();
lnkYourAcctShipAddy = new mshtml.HTMLAnchorElementClass();
lnkYourAcctPmtInfo = new mshtml.HTMLAnchorElementClass();

I realize that I have two different things above, the
mshtml.HTMLAnchorElement and the mshtml.HTMLAnchorElementClass. I have
this because I was trying to make either one work. I couldn't.

I know that I could load the page, and then put all the links in a
collection, and then click on the one that has an innerHTML matching
what I want. I was hoping to avoid that and simply be able to click on
the link I build, if it exists on the page.

Does anyone know how I would go about this?

I don't even know what you're trying to do. The first-paragraph
explanation makes it sound most like you want normal html links to
sequential pages.
 
B

Bergamot

jbonifacejr said:
I am using the mshtml and have the following lines...

Why don't you ask Microsoft how to use their stuff?
microsoft.public.[some newsgroup related to mshtml]
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top