jeudi 26 novembre 2020

Font-size and Font-family not changing through jquery

hello so this is my code : - code html-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="icon" href="iconFavicon.png">
    <link rel="stylesheet" href="styles.css">
   
</head>
<body>
<p>My Text Has To Be Changed </>
<button>1</button>
<button>2</button>
<button>3</button>
<button>4</button>
<button>5</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="index.js"></script>
</body>
</html>

css-

.text-change{ 
    font-size:2rem;
    font-family:cursive;
    color:black;
}

javascript-

$("p").addClass(".text-change")

Even after writing this statement in javascript i cannot change the font size or the font family of my text . Any kind of help would be appreciated .




Aucun commentaire:

Enregistrer un commentaire