Text decoration on scroll to top javascript code

554 views Asked by At

I have a link at the bottom of my page with

    <a href="javascript:scroll(0,0)">
Online Marketing
</a>

To scroll to top of page but it makes the text blue and underlined how do i add some code to remove text deceration to it?

i tried a href="javascript:scroll(0,0)" style="text-decoration: none; color:#FFFFFF;"> but then the scroll to top stopped working does anyone now any way to get round this to remove the text deceration using code on the specific element?

3

There are 3 answers

0
Chris M On BEST ANSWER

Your code looks right...which is odd. Perhaps try assigning the scroll button to a CSS class.

In your style sheet add

a.StandardTextLink:link, a.StandardTextLink:active, a.StandardTextLink:visited {text-decoration:none;color:#FFF;}

Then in your html

<a href="javascript:scroll(0,0)" class="StandardTextLink">Scroll to top</a>

Hopefully that'll sort it.

C

0
Niet the Dark Absol On

You could try not using an element that has default styles:

<span onClick="scroll(0,0);" style="cursor: pointer;">Online Marketing</span>
0
Teemu On

Check spelling of your style-attribute, especially quotas. Expression should work.