Interviewer And Interviewee Guide

Expert Developer JavaScript Interview Question:

How can the style/class of an element be changed?

Submitted by: Muhammad
It can be done in the following way:

JavaScript

document.getElementById("myText").style.fontSize = "20?;
or
document.getElementById("myText").className = "anyclass";
Submitted by: Muhammad

Read Online Expert Developer JavaScript Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.