WEBPROG.
9. Research the JavaScript string object, and discuss the
capabilities it provides. Include
examples of the object’s use.
10. Create an HTML file that creates a dog object that includes a
breed, name, and age. Assign
values to the object, and then use an alert dialog box to display
each field’s value.
Answer:
Note: The first question is done as HOMEWORKLIB guidelines, please repost others.
9)
The JavaScript string object allows us to play with the string of characters and it provides the means to manipulate the string object which is wrapped with a bunch of methods and Javascript primitive data type.
The syntax to create the string object is:
var theVal= new String(string);
Some of the string objects with there description are:
Constructor: The reference of the function will be returned which created the object
length: length of the string will be returned
prototype: The prototype property allows you to add properties and methods to an object.
Some methods:
charAt()
charCodeAt()
concat()
indexOf()
lastIndexOf()
Please give it a thumbs up if this helped you, also provide your valuable feedback.
WEBPROG. 9. Research the JavaScript string object, and discuss the capabilities it provides. Include examples of the object’s use. 10. Create an HTML file that creates a dog object that includes a bre...
Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and name variables (do not include topTrick). Note: The type refers to what the breed typically does; for example, a corgi would be a “cattle herding dog.” A Shiba Inu would be a “hunting dog.” Create the setTopTrick() mutator method Dog is parent class Corgi and Driver are subclasses Complete the Corgi class: Using the UML Class diagram, declare the instance variables. Create the two...
HTML------------------------------------------------------CSS---------------------------------------------------WEB230 - JavaScript 1 Assignment 7 - FormsSome of these tasks would be better done in HTML or CSS but do them in JavaScript to practice whatwe have learned.1. Select the form element and save it in a variable. From here we can access all of the form fields.2. When the page loads do the following:add the password value "monkey"select the favourite city "New York"clear the textarea3. Add an event handler to the "name" field to change the background color...
JavaScript Just use javascript, dont include HTML Follow the instructions bellow for a good rate Create a program that will display the result of three functions: a) sum the elements from the Fibonacci sequence b) divide them by randomly generated number c) calculate factorial from the rounded result of previous operation Functions should be stored in one, separate file. The main program should run from the app.js that is provided bellow, the other file should be called module.js that includes...
Can someone please help me with this javascript - Javascript - do at least 10 of the following questions below ----------------------------------------------------------------------------------- Create an HTML file that takes in input and carries out of the following functions and manipulates the DOM to show the outcome. Please put the question itself as a comment above each answer. Use either JavaScript, jQuery, or both (but know the difference!). ----------------------------------------------------------------------------------- 1. Fibonacci Define function: fib(n) Return the nth number in the fibonacci sequence. 2....
Need help with creating this JavaScript file. I'm not sure where
or how to begin.
1. You are working solely with the DOM object. Thus, you should be
coding primarily in the js file. You must use the addEventListener,
in addition you may need to use id and class attributes as needed.
The .html and .css files have been provided to you. See the .png
files for an example of what is expected.
2. Place the javaScript file in its...
WEB230 - JavaScript 1 Assignment 6a Use Events and DOM manipulation to create a playable Tic Tac Toe game. Do the following using JavaScript. Do not modify the HTML file. When you see this symbol: save and refresh the browser (this should happen automatically if you are using Brackets with Live Preview), then check your code to make sure it is working before you proceed. 1. Create two variables called "playerX" and "playero". Set them to the DOM element with...
The following code uses a Scanner object to read a text file called dogYears.txt. Notice that each line of this file contains a dog's name followed by an age. The program then outputs this data to the console. The output looks like this: Tippy 2 Rex 7 Desdemona 5 1. Your task is to use the Scanner methods that will initialize the variables name1, name2, name3, age1, age2, age3 so that the execution of the three println statements below will...