New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN: 9781305503922
Author: Patrick M. Carey
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 12CP1
Program Plan Intro
To write the JavaScript code for page element with ID plainsphere and use the function insertAdjacentHTML() to insert value of variable imgStr directly after elements opening tag.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
For the <span> element, set the left border to be 3 pixels, double, and red.
span {
}
HTML True or False
One can use padding inside a paragraph but not a div to enlarge the total size of the block element. (True or false)?
Assume you do not use a border statement for an internally placed block element inside a div element. You can displace the element from the top of an enclosing div element by either using margin-top in its selector command, but NOT alternatively by employing a padding command inside its enclosing div element css selector. (True or false)?
Paragraphs and header elements can have multiple span tabs , multiple images and multiple text but all are not held in an embedded vertical block structure. (True or false)?
One URL location within a single <a> html element can be accessed by a combination of multiple alternating text elements and images as long as the Link in not terminated by </a> until all the images and text elements have been created. (True or…
<style>// selecting required elementconst element = document.querySelector(".pagination ul");let totalPages = 10;let page = 2;
//calling function with passing parameters and adding inside element which is ul tagelement.innerHTML = createPagination(totalPages, page);function createPagination(totalPages, page){ let liTag = ''; let active; let beforePage = page - 1; let afterPage = page + 1; if(page > 1){ //show the next button if the page value is greater than 1 liTag += `<li class="btn prev" onclick="createPagination(totalPages, ${page - 1})"><span><i class="fas fa-angle-left"></i> Prev</span></li>`; }
// how many pages or li show before the current li if (page == totalPages) { beforePage = beforePage - 2; } else if (page == totalPages - 1) { beforePage = beforePage - 1; } // how many pages or li show after the current li if (page == 1) { afterPage = afterPage + 2; } else if (page == 2) { afterPage = afterPage +…
Chapter 9 Solutions
New Perspectives on HTML5, CSS3, and JavaScript
Ch. 9.1 - Prob. 2QCCh. 9.1 - What is the difference between asynchronously...Ch. 9.1 - Provide the command to display an alert dialog box...Ch. 9.1 - Prob. 8QCCh. 9.2 - Prob. 6QCCh. 9 - Prob. 2RACh. 9 - Prob. 4RACh. 9 - Prob. 5RACh. 9 - Prob. 6RACh. 9 - Prob. 7RA
Ch. 9 - Prob. 8RACh. 9 - Prob. 9RACh. 9 - Prob. 10RACh. 9 - Prob. 11RACh. 9 - Prob. 1CP1Ch. 9 - Prob. 2CP1Ch. 9 - Prob. 3CP1Ch. 9 - Prob. 4CP1Ch. 9 - Prob. 5CP1Ch. 9 - Prob. 6CP1Ch. 9 - Prob. 7CP1Ch. 9 - Prob. 8CP1Ch. 9 - Prob. 9CP1Ch. 9 - Prob. 10CP1Ch. 9 - Prob. 11CP1Ch. 9 - Prob. 12CP1Ch. 9 - Prob. 13CP1Ch. 9 - Prob. 14CP1Ch. 9 - Prob. 15CP1Ch. 9 - Prob. 16CP1Ch. 9 - Prob. 1CP2Ch. 9 - Prob. 2CP2Ch. 9 - Prob. 3CP2Ch. 9 - Prob. 4CP2Ch. 9 - Prob. 5CP2Ch. 9 - Prob. 6CP2Ch. 9 - Prob. 7CP2Ch. 9 - Prob. 8CP2Ch. 9 - Prob. 9CP2Ch. 9 - Prob. 10CP2Ch. 9 - Prob. 11CP2Ch. 9 - Prob. 12CP2Ch. 9 - Prob. 13CP2Ch. 9 - Return to the bc_today.js file and change the...Ch. 9 - Prob. 15CP2Ch. 9 - Prob. 1CP3Ch. 9 - Prob. 2CP3Ch. 9 - Prob. 3CP3Ch. 9 - Prob. 4CP3Ch. 9 - Prob. 5CP3Ch. 9 - Above the randomlnt() function insert a command to...Ch. 9 - Prob. 7CP3Ch. 9 - Prob. 8CP3Ch. 9 - Prob. 9CP3Ch. 9 - Prob. 10CP3Ch. 9 - Prob. 2CP4Ch. 9 - Prob. 3CP4Ch. 9 - Prob. 4CP4Ch. 9 - Prob. 5CP4Ch. 9 - Prob. 6CP4Ch. 9 - Prob. 7CP4Ch. 9 - Prob. 8CP4Ch. 9 - Explore 9. Scroll back to the top of the file and,...Ch. 9 - Prob. 10CP4Ch. 9 - Prob. 13CP4
Knowledge Booster
Similar questions
- Imagine that an xhtml document contains the following hyperlink tag I am Seven. When the link text (Seven) is clicked, the servlet with the URL pattern /process is called. Rewrite the code to instead use a form that submits to the same servlet to produce the exact same response using hidden form elements for any form parameters. The form should contain a submit button with the button text Seven. The form method should be get (case sensitive answer).arrow_forwardMake sure that the heading that starts with “Children’s Lessons” does not float to the right of the image by clearing the float at that element. In the ski.html file, add the following attribute/value pair to the opening tag that marks the Children’s Lessons heading: class="clearfloat"arrow_forwardFinally, within the form, add a div element containing a submit button displaying the text Begin Building your Order. (Hint: To code a submit button, use the input element and set its type attribute to "submit". You can also add a value attribute and set its value to the text you want to show on the button. Example: <input type="submit" value="This is text shown on the button">)arrow_forward
- Using functions right this code with javascriptarrow_forward***Please show steps on how to create the "userform" box" Create a userform with two sets of option boxes. Each set should be within a frame (Select frame element from the toolbox). The first frame should have 4 option buttons Basketball, Baseball, Football, and Soccer. The second frames should have two option buttons "watch on TV" and "go to games". The userform should have Submit and Cancel Button. Write a sub to show the userform When a user selects one option each from frame 1 and frame 2, you should have appropriate displays such as "Your favorite sports is Soccer and you usually watch on TV" if you selected Soccer and Watch on TV options, after you hit the Submit button. The userform should be hidden after submit button is clicked If the user clicks Cancel, you should display "You don't want to play this game" and hides the userformarrow_forwardFill in the missing parts of the following code required to change the body background color to light grey when the paragraph is clicked. //select the element to change b= //change the background element change my colorarrow_forward
- Return to the links.js file in your editor and create an event listener for the load event that runs an anonymous function. Within the anonymous function, create the allSelect variable referencing all select elements nested within the govLinks form. Loop through the allSelect object collection and for each selection list in the collection create an anonymous function for the onchange event. Within this anonymous function, use the href property of the location object to change the page shown in the browser window to the value of the target of the event object that initiated the onchange event. Document your commands with JavaScript comments.arrow_forwardGlobal Variable Go to the jpf_hitori.js file in your editor. Directly below the comment section, declare the global allCells variable, which you will use to store an array of the puzzle cells in the Hitori table. Do not define a value for the variable yet. JavaScript Functions Insert a command to run the startUp() function when the page is loaded by the browser. Add the startUp() function, which displays the contents of Puzzle 1 after the page is loaded and sets up the initial event handlers. Within the function, add the following commands: Change the inner HTML of the element with the ID, “puzzleTitle” to the text “Puzzle 1”. Call the drawHitori() function using the hitori1Numbers, hitori1Blocks, and hitori1Rating variables as parameter values and store the HTML code returned by the function in the inner HTML of the page element with the ID “puzzle”. Declare a variable named puzzleButtons referencing the page elements with the class name “puzzles”. Loop through the puzzleButtons…arrow_forwardCreate an interactive sign-up sheet.● Make the sign-up sheet interactive for the user.● Add a selection element to ask the user for their gender. Add the options “Male,” “Female,” and “Prefer not to mention.”● Use onblur and onfocus to add red borders to the input elements when the user leaves without any input, and a green border if a value is typed and the user is done with the input element.● Upon submission of the form, print all the information that the user has provided on a div or p tag at the bottom of the page.● Use fieldset and legend tag to separate the input part from the output part of the form.● Include a reset button to clear users input and also the information displayed at the bottom of the page.● Feel free also to design your own version and add other features.arrow_forward
- Step 20: Mobile Styles When the user views the page on a mobile device, we don't want the label elements to appear to the left of the input elements because that takes up too much horizontal space. We need to adjust our layout to be more vertical. Create a media query for screens with a maximum width of 767 pixels. Inside the media query, add a rule for any label elements inside the form element with the id registration that removes the float, sets the width to 100%, and aligns the text to the left. Add a rule inside the media query for any input element inside the form element with the id registration that removes the float and sets the width to 100%. Because we set specific widths for the input elements that appear on a single row, we need to override those settings in the mobile view. Add a rule inside the media query for the input elements with the ids city, state, and zip inside the form element with the id registration that sets the maximum width to 100%. Add a rule…arrow_forwardWhen you set the margin left and margin right values to auto, then the element will be positioned at the bottom O right left centerarrow_forwardConsider the following HTML code to answer the question below 1. 2. .. ...... 3. 4. 5. ... ...... 6. .. ...... 7. 8. 9. 10. 11. .. ...... 12. .. ...... 13. ... ...... 14. 15. .. 16. Using the selector div p {}, the style will be applied on which lines Select one: a. line 2 only b. lines: 2, 6, 11 c. lines: 2, and 6 d. line: 2, 6, 11, 13arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage