Let's have some fun here. Create a page with a text box and a submit button. The user will put the URL for an existing web page in the text box. Then, when the button is pressed, you will open a new window containing that page. Obviously, to get around the security restrictions, the file you open must be on the same server as the form, but that's OK. After the window loads, get all the paragraphs. You will edit the text in those paragraphs and convert it to 'Pig Latin'. The basic rules for converting to Pig Latin are as follows:
In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and "ay" is added. For instance, "beast" becomes "east-bay" and "dough" becomes "ough-day"
In words that begin with vowel sounds or silent consonants, the syllable "ay" is simply added to the end of the word.
I have to webpages, one is assign8.html and the other is assign8_2.html. For testing purposes, I want assign8_2.html to be the URL entered in the textbox of assign8.html.
var url = document.getElementById("userinput").value;
var strings = document.getElementsByTagName("p").value.split( " " );
for (i in strings)
strings[i] = strings[i].substr(1) + strings[i].charAt(0) + "ay"
Enter a URL: <br><br>
<input type = "text" name = "text1" size = "50" id = "userinput">
<input type = "button" value = "Submit" onclick = "translation()"> <br><br>
<p>I like chicken, I like liver.</p>
<p>Meow Mix, Meow Mix please deliver!</p>
I am not getting it to work and obviously I am doing something wrong. I really don't know what I am doing wrong. I wish the assignment would call for a pig latin conversion from one text box to another, that'd bbe easy. Any assistance is greatly appreciated, thanks!4 AnswersProgramming & Design1 decade ago
I would like to get the result number from "getElementsByTagName" into a drop down menu. If I just do a document.write or an alert, it will let me know there are four paragraphs. I would like for each paragraph number to be in a box so it looks like...
Here is what I have right now.
var x = document.body.getElementsByTagName("p");
var y = x.length;
for (var i = 0; i <= y; i ++)
<body onload = "getParagraphs()">
<font face = "calibri">
<form name = "project">
<table border = "1">
<td align = "center"><select id = "para"></select></td>
Any ideas on how to fix this would be great, thanks in advance!3 AnswersProgramming & Design1 decade ago
Hi. I am working on building a quiz where after 10 minutes if the student clicks on "submit" they will be told time has expired and refresh the page to start again. I have attempted the code below and it keeps providing me with the first alert - "Try again.". Maybe someone can help me out...
var begin = setTimeout("", 5000);
if (begin != 5000)
alert("Your quiz has been submitted.");
<body onload = "setTime()">
<font face = "calbiri">
<form name = "quiz">
FName: <input type = "text" name = "fname"><br><br>
LName: <input type = "text" name = "lname"><br><br>
<input type = "button" name = "button1" value = "submit" onclick = "timeQuiz()" /> <input type = "button" name = "button2" value = "reset" onclick = "document.quiz.reset()" />
</html>2 AnswersProgramming & Design1 decade ago
Not trying to be a pervert here, just wanting to get everyone's input and see what they think it is.4 AnswersSingles & Dating1 decade ago