Avatar of shampouya
shampouya
 asked on

Why does my javascript statement stop working once I use jquery?

This line in my js file seems to stop working if I try to change my website color from pink to purple (see webpage below):

      document.getElementById("submit").className = 'formButtonPurple';

http://www.pouyarebek.com/wdiclass/assignment4/homework4.html
JavaScriptHTML

Avatar of undefined
Last Comment
shampouya

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Sudhindra A N

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
shampouya

ASKER
Ok these two ways seem to work now. Is there no difference between these two in terms of which one gets preference?

      $(".formButton").css("background-color", "#5959ff");
      document.getElementById("submit").style.background = "#5959ff";
Sudhindra A N

I personally prefer using jQuery method as there will be a uniformity in coding.
shampouya

ASKER
thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck