Javascript jQuery - Display inches in feet and inches

0 votes

I'm making a BMI calculator (see JSFiddle - http://jsfiddle.net/b5ww2/) and I want the height in inches to display in feet and inches. I also want the weight in pounds to be displayed in stones and pounds.

This is the code I'm using to convert the slider value to cm and inches:

slide: function( event, ui ) {
  $( "#heightslidecm" ).html( ui.value + 'cm' );
  $( "#heightslidein" ).html( (ui.value*0.393700787).toFixed(0) + 'in' );
}

My js knowledge isn't great - especially when it comes to the math aspect.

Any ideas?

Thanks in advance

Jul 29, 2022 in Web Development by gaurav
• 23,260 points
331 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
0 answers

Swipe up and Swipe down in javascript or jquery

I am trying to do swipe up ...READ MORE

Aug 24, 2022 in Web Development by gaurav
• 23,260 points
814 views
0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

Get Current Date In DD-Mon-YYY Format In ...READ MORE

answered Jun 28, 2022 in Web Development by rajatha
• 7,640 points
827 views
0 votes
1 answer

How to display current element in jQuery?

<! DOCTYPE html> <html> <head> <script> $(document). ready(function(){ $("button"). click(function(){ $("p"). text("Welcome to ...READ MORE

answered Jun 27, 2022 in Web Development by rajatha
• 7,640 points
986 views
0 votes
1 answer

What is the difference between JavaScript and jQuery?

JavaScript is an independent language and can ...READ MORE

answered Jun 27, 2022 in Web Development by rajatha
• 7,640 points
379 views
0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

get current date in jquery in dd/mm/yyyy ...READ MORE

answered Jun 27, 2022 in Web Development by rajatha
• 7,640 points
5,312 views
0 votes
0 answers

JavaScript style.display="none" or jQuery .hide() is more efficient?

document.getElementById("elementId").style.display="none" is used in JavaScript to hide an ...READ MORE

Jun 29, 2022 in Web Development by gaurav
• 23,260 points
3,260 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,510 points
924 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
13,877 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
22,212 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,880 points
2,864 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP