Monday, May 18, 2020

Fahrenheit To Celsius Converter in jQuery

I wrote this program to ask the user to give temperature in Fahrenheit and the program will convert the given temperature into Celsius equivalent using jQuery.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/


Program Listing

<html>
<head>
<title>Fahrenheit To Celsius Converter in jQuery</title>
<script src="jquery-3.2.1.min.js"></script>
<style>
body {
 background-color:white;
 font-family: arial;
 font-size:15px;
 font-weight:bold;
 }

 .input_bold {
    font-weight: bold;
 font-size:15px;
 color:blue;
}

.input_bold2 {
    font-weight: bold;
 font-size:15px;
 color:black;
 }

.left {
    width: 20%;
    float: left;
    text-align: right;
    
}
.right {
    width: 20%;
    margin-left: 20px;
    float:left;
}

.header {
    width: 37%;
    float: left;
    text-align: right;
}

h4 {
text-align: center;
}
</style> 
<script>
    /* solve button */
$(document).ready(function() {
 
    $("#fahrenheit").on("keydown keyup", function() {
       var fah = $("#fahrenheit").val();
       celsius = (fah-32) * 5 / 9; 
       $("#results").val(celsius.toFixed(2) +" "+ String.fromCharCode(176) + "C");
     });
   
/* clear button */
    $("#clear").click(function(){
    $("#fahrenheit").val('');
    $("#results").val('');
    $("#fahrenheit").focus();
   });

});
 </script>
</head>
<body>
<form>
<div class="header">
<h3>Fahrenheit To Celsius Converter in jQuery</h3>
</div>
<br><br><br><br>
<div class="left">
 Temperature in Fahrenheit 
</div>
<div class="right">
 <input type="text" id="fahrenheit"  name="fahrenheit"  class="input_bold2 "size="10" autofocus/><br>
</div>
<br><br>
<div class="left">
Celsius  Equivalent
</div> 
<div class="right">
 <input type="text" id="results" name="results"  class="input_bold" size="10" readonly />
</div> 
<br><br>
<div class="right">
<button type= "button" id ="clear" title="Click here to clear the textbox.">
Clear </button> 
<br>
</div>
</form>
</body>
</html>


No comments:

Post a Comment