Capture Text Portion of a Website Link

Avatar

Avatar
Validate 25
Level 4
alim92960278
Level 4

Likes

37 likes

Total Posts

103 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 4
alim92960278
Level 4

Likes

37 likes

Total Posts

103 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
alim92960278
Level 4

17-02-2016

I'm capturing clicks on website links but can't figure out how to capture the link text.

I'm using the Custom Page Code section of an Event Based Rule

Sample link: <a class="schoolLink" href="http://www.example.com" target="_blank">Our New Website</a>

I know how to get the HREF:

var Link = this.getAttribute('href');
_satellite.notify("Link: "+Link);

Result: "SATELLITE: Link: http://www.sample.com"

How can I get the TEXT ("Our New Website")?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

17-02-2016

Hi Ali, 

As per our understanding for getting the text "Our New Website" , you have to use "this.innerHTML"  . Please see the below sample code for more details .

var LinkName = this.innerHTML;
_satellite.notify("Linkname: "+LinkName);

please let us know in case of any questions or queries.

Thanks & Regards

Parit Mittal

Answers (1)

Answers (1)

Avatar

Avatar
Validate 25
Level 4
alim92960278
Level 4

Likes

37 likes

Total Posts

103 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 4
alim92960278
Level 4

Likes

37 likes

Total Posts

103 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
alim92960278
Level 4

18-02-2016

Excellent! Thanks for the help Parit.

Ali