The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we help you to solve your academic and programming questions fast.
In eduladder you can Ask,Answer,Listen,Earn and Download Questions and Question papers.
Watch related videos of your favorite subject.
Connect with students from different parts of the world.
Apply or Post Jobs, Courses ,Internships and Volunteering opportunity. For FREE
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions

PROGRAMMING-THE-WEB-10CS73-->View question

Write a program in XHTML to create five radio buttons,?

labelled red, blue, green, yellow and orange. The event handlers for these buttons must produce message stating the chosen favourite color. The Event handler must be implemented as a function. Assign the event handler to the event property of the button element. Asked (10 Marks) (Jun/July-2013)


Asked On2017-05-15 19:48:32 by:Rajiv

Taged users:


Likes:
Be first to like this question

Dislikes:
Be first to dislike this question
Talk about this  Like  Dislike
View all qusetions
Answers

<?xml version = "1.0" encoding = "utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- e51.hmtl A solution to ExercCSE 5.1 - events with radio buttons --> <html xmlns = "http://www.w3.org/1999/xhtml">

<head>

<title> ExercCSE 5.1 </title>

<script type = "text/javascript" src = "e51.js" >

</script>

</head>

<body>

<h4> Choose your favorite color </h4>

<form>

<label> <input type = "radio" name = "colorButton" value = "red" onClick = "colorChoice('red')" /> Red </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "blue" onClick = "colorChoice('blue')" /> Blue </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "green" onClick = "colorChoice('green')" /> Green </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "yellow" onClick = "colorChoice('yellow')" /> Yellow </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "orange" onClick = "colorChoice('orange')" /> Orange </label>

</form>

</body>

</html>

// e51.js - The JavaScript solution for ExercCSE 5.1

// // The event handler function to produce an alert message about the chosen color function colorChoice (color) { switch (color) { case "red": alert("Your favorite color is red"); break;

case "blue": alert("Your favorite color is blue"); break;

case "green": alert("Your favorite color is green"); break;

case "yellow": alert("Your favorite color is yellow"); break;

case "orange": alert("Your favorite color is orange");

break; default: alert("Error in JavaScript function colorChoice"); break; } }


Answerd on:2015-11-21 Answerd By:neenu2

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this  Like  Dislike

You might like this video:Watch more here

Watch more videos from this user Here

Learn how to upload a video over here

<?xml version = "1.0" encoding = "utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- e51.hmtl A solution to ExercCSE 5.1 - events with radio buttons --> <html xmlns = "http://www.w3.org/1999/xhtml">

<head>

<title> ExercCSE 5.1 </title>

<script type = "text/javascript" src = "e51.js" >

</script>

</head>

<body>

<h4> Choose your favorite color </h4>

<form>

<label> <input type = "radio" name = "colorButton" value = "red" onClick = "colorChoice('red')" /> Red </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "blue" onClick = "colorChoice('blue')" /> Blue </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "green" onClick = "colorChoice('green')" /> Green </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "yellow" onClick = "colorChoice('yellow')" /> Yellow </label>

<br />

<label>

<input type = "radio" name = "colorButton" value = "orange" onClick = "colorChoice('orange')" /> Orange </label>

</form>

</body>

</html>


// // The event handler function to produce an alert message about the chosen color function colorChoice (color) { switch (color) { case "red": alert("Your favorite color is red"); break;

case "blue": alert("Your favorite color is blue"); break;

case "green": alert("Your favorite color is green"); break;

case "yellow": alert("Your favorite color is yellow"); break;

case "orange": alert("Your favorite color is orange");

break; default: alert("Error in JavaScript function colorChoice"); break; } }


Answerd on:2019-08-28 Answerd By:Annaliya

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this  Like  Dislike

You might like this video:Watch more here

Watch more videos from this user Here

Learn how to upload a video over here



Lets together make the web is a better place

We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.

You can also contribute to our vision of "Helping student to pass any exams" with these.
Answer a question: You can answer the questions not yet answered in eduladder.How to answer a question
Career: Work or do your internship with us.Work with us
Create a video: You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder