Question: Please give me the code to do this, I could not figure it out last time I did it and want to see where I
Please give me the code to do this, I could not figure it out last time I did it and want to see where I went wrong
for practice and learning purposes!!! this is an old prject
You might be better off just looking at the screenshots!!
Task : Create an index.html
As always, create the proper folders and an index, css and JavaScript files for this lab. And make sure you also put a link from your art homepage to
this lab
As usual, create an index.html with three organized sections: Challenge, Problems, and Results
Use heading, div, and paragraph tags to organize your page
Include jQuery in the of your HTML along with your css and JavaScript with: Task : Create a CSS file for your lab
Do all the usual things to gussy up your page letting your creativity fly. Once you get your JavaScript working, you may want to go back and customize
the results of your JavaScript in CSS Here's what mine looks like:
text p
display: inlineblock;
maxwidth: ;
margin: ;
padding: px;
borderradius: px;
backgroundcolor: darkgray;
color: white;
fontfamily: sansserif;
fontsize: ;
Task : Create a JavaScript file
Create a new javascript file or use the existing template in your code editor in your lab's js folder.
Comment block: Put a comment block at the top of your program. Here's what mine looks like:
lab.js This simple JavaScriptjQuery script appends new elements to an output div
Requirements: jQuery must be loaded for this script to work.
Author: Wes modes
Date:
Let's create a little helper function that will generate some fake dialogue:
function generateRandomText
const text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut const text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
const min;
const max
const randLen Math.floorMath randommin;
Get a random starting index to slice the Lorem Ipsum text
const randStart Math.floorMathrandomtextlength randLen ;
Generate the random Lorem Ipsumlike text
return text.slicerandStart randStart randLen;
Add an event listener for your button:
Within the event listener call back, call our little helper function and save the results:
Now, select your output div and append a new div with your newText:
Test your button.
Remember:
Experiment with new commands in the JavaScript console to see how they work
Add comments to your function to say what it does
In the body of your HTML add a section in which we can put our output:
Put a button under your output div:
Add a link to your JavaScript file in your index page.
Take a screenshot of your source code in the editor.
Task : Create a CSS file for your lab
Do all the usual things to gussy up your page letting your creativity fly. Once you get your JavaScript working, you may want to go back and customize
the results of your JavaScript in CSS Here's what mine looks like:
text
display: inlineblock;
maxwidth:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
