SlideShare a Scribd company logo
1 of 4
Download to read offline
<h1>JavaScript Can Validate Input</h1>
<p>Please input a char between 'd' and 'm':</p>
<input id="character">
<button type="button" onclick="myFunction()">Submit</button>
<p id="WEBT2300"></p>
<script>
function myFunction() {
var x, text;
//Get the value of the input field: id="numb"
x = document.getElementById("character").value;
// If x is Not a char
// or >= than 'd' or <= than 'm'
else {
// text is ok
}
document.getElementById("WEBT2300").innerHTML = text;
}
</script>
Which code will do the above?
Question 11 options:
if (!NaN(x) && x >= 'd' && x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
if (!isNaN(x) && x > 'd' || x < 'm') {
text = "Input not valid";
} else {
text = "Input OK";
}
if (!NaN(x) && x >= 'd' || x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
if (!isNaN(x) || x >= 'd' && x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
if (!NaN(x) && x >= 'd' && x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
if (!isNaN(x) && x > 'd' || x < 'm') {
text = "Input not valid";
} else {
text = "Input OK";
}
if (!NaN(x) && x >= 'd' || x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
if (!isNaN(x) || x >= 'd' && x <= 'm') {
text = "Input not valid";
} else {
// text is ok
text = "Input OK";
}
Validate JavaScript Input Between Characters

More Related Content

Similar to Validate JavaScript Input Between Characters

JAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfJAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfAAFREEN SHAIKH
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04Spy Seat
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation TechniqueMorshedul Arefin
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireAndreas Nedbal
 
having trouble with my code I'm using VScode to code a javascript code.docx
having trouble with my code I'm using VScode to code a javascript code.docxhaving trouble with my code I'm using VScode to code a javascript code.docx
having trouble with my code I'm using VScode to code a javascript code.docxIsaac9LjWelchq
 

Similar to Validate JavaScript Input Between Characters (7)

JAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfJAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdf
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
 
Forms
FormsForms
Forms
 
Exp6
Exp6Exp6
Exp6
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
 
having trouble with my code I'm using VScode to code a javascript code.docx
having trouble with my code I'm using VScode to code a javascript code.docxhaving trouble with my code I'm using VScode to code a javascript code.docx
having trouble with my code I'm using VScode to code a javascript code.docx
 

More from AdrianEBJKingr

1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf
1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf
1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdfAdrianEBJKingr
 
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdfAdrianEBJKingr
 
1- A General Right to Privacy was written explicitly into the US Const.pdf
1- A General Right to Privacy was written explicitly into the US Const.pdf1- A General Right to Privacy was written explicitly into the US Const.pdf
1- A General Right to Privacy was written explicitly into the US Const.pdfAdrianEBJKingr
 
1- A business has the following information for the year- Determine th.pdf
1- A business has the following information for the year- Determine th.pdf1- A business has the following information for the year- Determine th.pdf
1- A business has the following information for the year- Determine th.pdfAdrianEBJKingr
 
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdfAdrianEBJKingr
 
1- (Aggregates) Consider an economy that is in below full employment e.pdf
1- (Aggregates) Consider an economy that is in below full employment e.pdf1- (Aggregates) Consider an economy that is in below full employment e.pdf
1- (Aggregates) Consider an economy that is in below full employment e.pdfAdrianEBJKingr
 
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdfAdrianEBJKingr
 
-The following information applies to the questions displayed below- O.pdf
-The following information applies to the questions displayed below- O.pdf-The following information applies to the questions displayed below- O.pdf
-The following information applies to the questions displayed below- O.pdfAdrianEBJKingr
 
-NYP-- New York Paper Co-- is using its financial results for August 2.pdf
-NYP-- New York Paper Co-- is using its financial results for August 2.pdf-NYP-- New York Paper Co-- is using its financial results for August 2.pdf
-NYP-- New York Paper Co-- is using its financial results for August 2.pdfAdrianEBJKingr
 
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdfAdrianEBJKingr
 
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdfAdrianEBJKingr
 
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdfAdrianEBJKingr
 
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdfAdrianEBJKingr
 
-10 points- For each of the Regular Expression- draw FA recognizing th.pdf
-10 points- For each of the Regular Expression- draw FA recognizing th.pdf-10 points- For each of the Regular Expression- draw FA recognizing th.pdf
-10 points- For each of the Regular Expression- draw FA recognizing th.pdfAdrianEBJKingr
 
--What is wrong with this C++ program- -- # include iostream using nam.pdf
--What is wrong with this C++ program- -- # include iostream using nam.pdf--What is wrong with this C++ program- -- # include iostream using nam.pdf
--What is wrong with this C++ program- -- # include iostream using nam.pdfAdrianEBJKingr
 
-10 points- Construct minimized DFA accepting language represented by.pdf
-10 points- Construct minimized DFA accepting language represented by.pdf-10 points- Construct minimized DFA accepting language represented by.pdf
-10 points- Construct minimized DFA accepting language represented by.pdfAdrianEBJKingr
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdfAdrianEBJKingr
 
--kindly help---Explain what happens when the PUSHA instruction execut.pdf
--kindly help---Explain what happens when the PUSHA instruction execut.pdf--kindly help---Explain what happens when the PUSHA instruction execut.pdf
--kindly help---Explain what happens when the PUSHA instruction execut.pdfAdrianEBJKingr
 
1)What is the most important benefit you believe students get from the.pdf
1)What is the most important benefit you believe students get from the.pdf1)What is the most important benefit you believe students get from the.pdf
1)What is the most important benefit you believe students get from the.pdfAdrianEBJKingr
 

More from AdrianEBJKingr (20)

1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf
1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf
1- Answer the following characteristics for Chytridiomycota Fungi- A-.pdf
 
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf
1- A TIPS has a coupon of 7-- paid semiannually- The current rate of i.pdf
 
1- A General Right to Privacy was written explicitly into the US Const.pdf
1- A General Right to Privacy was written explicitly into the US Const.pdf1- A General Right to Privacy was written explicitly into the US Const.pdf
1- A General Right to Privacy was written explicitly into the US Const.pdf
 
1- A business has the following information for the year- Determine th.pdf
1- A business has the following information for the year- Determine th.pdf1- A business has the following information for the year- Determine th.pdf
1- A business has the following information for the year- Determine th.pdf
 
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf
1- -8 points- Write a MIPS code to compute the factorial of a positive.pdf
 
1- (Aggregates) Consider an economy that is in below full employment e.pdf
1- (Aggregates) Consider an economy that is in below full employment e.pdf1- (Aggregates) Consider an economy that is in below full employment e.pdf
1- (Aggregates) Consider an economy that is in below full employment e.pdf
 
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf
1- (3 polats) O Suppose that A add B are ladepedbet ewnts- Furthemore-.pdf
 
-The following information applies to the questions displayed below- O.pdf
-The following information applies to the questions displayed below- O.pdf-The following information applies to the questions displayed below- O.pdf
-The following information applies to the questions displayed below- O.pdf
 
-NYP-- New York Paper Co-- is using its financial results for August 2.pdf
-NYP-- New York Paper Co-- is using its financial results for August 2.pdf-NYP-- New York Paper Co-- is using its financial results for August 2.pdf
-NYP-- New York Paper Co-- is using its financial results for August 2.pdf
 
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf
-Java lang- Q3 (10)- A program creates a queue- The program takes arra.pdf
 
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf
-2-Cyanide is a highly fast-acting poison- In fact- it was developed a.pdf
 
-23-.pdf
-23-.pdf-23-.pdf
-23-.pdf
 
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf
-begin{tabular}{l-l} cHALlenge -- ACriviry -end{tabular} 4-3-1- Confid.pdf
 
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf
---BUS-- public class Bus { String busIdentifier- String driverName- d.pdf
 
-10 points- For each of the Regular Expression- draw FA recognizing th.pdf
-10 points- For each of the Regular Expression- draw FA recognizing th.pdf-10 points- For each of the Regular Expression- draw FA recognizing th.pdf
-10 points- For each of the Regular Expression- draw FA recognizing th.pdf
 
--What is wrong with this C++ program- -- # include iostream using nam.pdf
--What is wrong with this C++ program- -- # include iostream using nam.pdf--What is wrong with this C++ program- -- # include iostream using nam.pdf
--What is wrong with this C++ program- -- # include iostream using nam.pdf
 
-10 points- Construct minimized DFA accepting language represented by.pdf
-10 points- Construct minimized DFA accepting language represented by.pdf-10 points- Construct minimized DFA accepting language represented by.pdf
-10 points- Construct minimized DFA accepting language represented by.pdf
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
 
--kindly help---Explain what happens when the PUSHA instruction execut.pdf
--kindly help---Explain what happens when the PUSHA instruction execut.pdf--kindly help---Explain what happens when the PUSHA instruction execut.pdf
--kindly help---Explain what happens when the PUSHA instruction execut.pdf
 
1)What is the most important benefit you believe students get from the.pdf
1)What is the most important benefit you believe students get from the.pdf1)What is the most important benefit you believe students get from the.pdf
1)What is the most important benefit you believe students get from the.pdf
 

Recently uploaded

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 

Validate JavaScript Input Between Characters

  • 1. <h1>JavaScript Can Validate Input</h1> <p>Please input a char between 'd' and 'm':</p> <input id="character"> <button type="button" onclick="myFunction()">Submit</button> <p id="WEBT2300"></p> <script> function myFunction() { var x, text; //Get the value of the input field: id="numb" x = document.getElementById("character").value; // If x is Not a char // or >= than 'd' or <= than 'm' else { // text is ok } document.getElementById("WEBT2300").innerHTML = text; } </script> Which code will do the above? Question 11 options: if (!NaN(x) && x >= 'd' && x <= 'm') { text = "Input not valid"; } else {
  • 2. // text is ok text = "Input OK"; } if (!isNaN(x) && x > 'd' || x < 'm') { text = "Input not valid"; } else { text = "Input OK"; } if (!NaN(x) && x >= 'd' || x <= 'm') { text = "Input not valid"; } else { // text is ok text = "Input OK"; } if (!isNaN(x) || x >= 'd' && x <= 'm') { text = "Input not valid"; } else { // text is ok text = "Input OK"; } if (!NaN(x) && x >= 'd' && x <= 'm') { text = "Input not valid"; } else {
  • 3. // text is ok text = "Input OK"; } if (!isNaN(x) && x > 'd' || x < 'm') { text = "Input not valid"; } else { text = "Input OK"; } if (!NaN(x) && x >= 'd' || x <= 'm') { text = "Input not valid"; } else { // text is ok text = "Input OK"; } if (!isNaN(x) || x >= 'd' && x <= 'm') { text = "Input not valid"; } else { // text is ok text = "Input OK"; }