Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new-branch #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions day.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

//var x= document.getElementById('Age').value;
//if (x<50000)
//document.write('basic salary');
//if (x>50000)
//document.write('huge salary');

document.getElementById('submit').addEventListener('click', function(e){
e.preventDefault();

var x= document.getElementById('Salary').value;
var y=document.getElementById('output');
if (x<50000){
y.append('Basic salary');
}
else if (x<200000){
y.append('Mid Earner');

}
else{
y.append('High Earner');
y='High Earner'
}



})
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Javascript-2</title>
</head>
<body>
<h4> Kindly input the amount you earn monthly</h4>
<div>
<label for="Salary">Salary:</label>
<input type="number" id="Salary">
</div>
</br>
<div>
<input type="submit" value="Submit" id="submit">
</div>
</form>
<div id="result">
<p id="output"></p>
</div>
<script type="text/javascript" src="day.js"></script>
</body>
</html>
Empty file added style.css
Empty file.