This is the code from assignment 2 <!DOCTYPE html> <html> <head> <meta http-equi
ID: 3607162 • Letter: T
Question
This is the code from assignment 2
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<p>helllloooo I am Karlyle Jones<span> I love to take long walks</span> in the park. People <span>Underestimate
me</span>,and tend <span> to get</span> <span>me confused with my brother</span>
<span> Kahlil </span>. </p>
<p> People take me for granted but i will still succeed
As long as i follow my career plan nothing can stop me. </p>
<p> Success doesnt come easy but through hard work
nothing is impossible. I have to make my parents proud. </p>
</body>
</html>
Explanation / Answer
Code:
<html>
<head>
<link href="http://fonts.googleapis.com/css?family=Lato" rel='stylesheet' type='text/css'>
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#IncreaseSize').click(function(){
curSize= parseInt($('#content').css('font-size')) + 2;
if(curSize<=20)
$('#content').css('font-size', curSize);
});
});
$(document).ready(function() {
$("#chageBackground").click(function() {
$('#background').css('background-color', 'blue');
});
});
</script>
</head>
<body>
<p>helllloooo I am Karlyle Jones<span> I love to take long walks</span> in the park. People <span>Underestimate
me</span>,and tend <span> to get</span> <span>me confused with my brother</span>
<span> Kahlil </span>. </p>
<p id="background"> People take me for granted but i will still succeed
As long as i follow my career plan nothing can stop me. </p></span>
<span id="content">
<p> Success doesnt come easy but through hard work
nothing is impossible. I have to make my parents proud. </p>
</span>
<br/>
<a href="#" id="IncreaseSize" class="button buttonfont">increaseFont</a>
<a href="#" id="chageBackground" class="button buttonfont">changeBackground</a>
</body>
</html>
I used Jquery to change the background of color I used
To increase size I used
curSize= parseInt($('#content').css('font-size')) + 2;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.