-3

I have written the majority of my site in vanilla javascript and for the sake of consistency could someone please advise how I would translate the following... Thank you!

 $("a").click(function(){ $("p").fadeOut(3000); });
j08691
  • 204,283
  • 31
  • 260
  • 272
Darren
  • 105
  • 1
  • 9
  • 1
    What did you try so far? Did you search? I'm sure this has been answered somewhere or can be found via Google. – Danmoreng Oct 28 '15 at 12:29
  • Possible duplicate of [javascript fade out (vanilla js example) not working for me](http://stackoverflow.com/questions/17655298/javascript-fade-out-vanilla-js-example-not-working-for-me) – Danmoreng Oct 28 '15 at 12:30
  • For the fadeout I would probably use a CSS class w/ transition. Then just grab the element and add the class when its clicked on. – Andy Oct 28 '15 at 12:35

1 Answers1

0

https://stackoverflow.com/a/17656038/3599496

View that link, it has the answer you're looking for. For the click event, view:

http://www.w3schools.com/jsref/event_onclick.asp

Community
  • 1
  • 1
Joshua Bakker
  • 2,288
  • 3
  • 30
  • 63