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

URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
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
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
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
 
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
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
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
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
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
 
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
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

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"; }