Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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>

For this part use the same paragraph you wrote for assignment #2 or write a random paragraph. . Create two buttons with value "Increase Font" and value-"Change Background". Make sure you give them separate ids as well. Create an event per button with wnclick- "Increasesize ( ) " and wnclick = "Change Background () ". Your script tags should encapsulate the function definitions and implementations. See examples on http://www.w3schools.com/tags/ev onclick.asp IncreaseSize) should increase the font of a selected sentence within your paragraph. Use span tag to select a sentence. .ChangeBaskazaund) should change the background color of your paragraph. Make sure you give the paragraph an id to be able to do so.

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;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote