JavaScript concernsIs this the best way in jQuery to handle a button being pressed without making an HTTP req?$(#input-box-form).submit( function(event) {    event.preventDefault();    var data = getParityData();    showParityData(data);});This seems like a mess/redundant/I'm not doing it right.  How can I make it better with CSS/JavaScript?$(#input-box).keyup( function(event) {    var input_num = $(#input-box).val();    if (input_num.match(^0b)){        bin_num = input_num.slice(2);        if (!(/^[0|1]+$/.test(bin_num))){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else {            $(#input-box-form).removeClass(has-error);            $(#generate-button).prop('disabled',false);        }    } else {        bin_num = (+input_num).toString(2);        if( input_num.length == 0 ){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else if (isNaN(bin_num)){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else {            $(#input-box-form).removeClass(has-error);            $(#generate-button).prop('disabled',false);        }    }});Edit - After talking with my friend, I re-worked the above:$(#input-box).keyup( function(event) {    var input_num = $(#input-box).val();    if (input_num.match(^0b)){        bin_num = input_num.slice(2);        is_error = !(/^[0|1]+$/.test(bin_num));    } else {        bin_num = (+input_num).toString(2);        is_error = isNaN(bin_num);    }    $(#input-box-form).toggleClass(has-error,is_error);    $(#generate-button).prop('disabled',is_error);});Any code suggestions to make it more JavaScript-onic?HTML concernsAny improvements on bootstrap [mis]usage?Any suggestions on structure/naming conventions?Anything else missing from my html file?Functionality/usabilityhttp://paritybitgenerator.comIs there anything confusing to the end user?Can I make the experience better?Are there any suggestions for things to add to the site?HTML code:<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><link href=http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css rel=stylesheet><link rel=stylesheet href=http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css><link rel=stylesheet href=mystyle.css><title>Parity Bit Generator</title><body><div class=container>    <h1><strong>Parity Bit Generator</strong></h1>    <form class=form-inline role=form id=input-box-form >        <div class=form-group>            <label class=sr-only for=number>Input Number</label>            <input type=text class=form-control input-lg id=input-box placeholder=1234, 0b10, 0xBA>        </div>        <button type=submit class=btn btn-primary btn-lg id=generate-button disabled=true>Generate</button>    </form>    <div id=result-section >    </div></div><script src=https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js></script><script src=http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js></script><script src=handlebars-v1.3.0.js></script><script src=parity-bit-generator.js></script><script src=google-analytics.js></script><script id=parity-data-template type=text/x-handlebars-template>     <div class=alert alert-success id=alert-section role=alert>       <div id=input-info-section class=row>           <div class=col-sm-12>               <i class=fa fa-chevron-right></i>               <i class=fa fa-chevron-right></i>               <p> {{ input_num }}  </p>           </div>       </div>       <div id=parity-data-section class=row>           <div class=col-sm-3>               <p><em>binary</em></p>               <p> {{ bin_num }}  </p>            </div>            <div class=col-sm-3>                <p><em>count of 1s</em></p>                <p class=large> {{ count_of_1s }}  </p>            </div>            <div class=col-sm-3>                <p><em>even parity</em></p>                <p> {{ even_parity }} </p>            </div>            <div class=col-sm-3>                <p><em>odd parity</em></p>                <p> {{ odd_parity }}  </p>            </div>        </div>      </div>  </script></body></html>JavaScript:function getParityData(){    var data = {};    data.input_num = $(#input-box).val();    if (data.input_num.match(^0b)){        data.bin_num = data.input_num.slice(2);    } else {        data.bin_num = parseInt(data.input_num).toString(2);    }    data.count_of_1s = data.bin_num.match(/1/g).length;    data.even_parity = data.count_of_1s % 2;    data.odd_parity = (data.count_of_1s + 1) % 2;    return data;}function showParityData(data){    var source = $(#parity-data-template).html();    var template = Handlebars.compile(source);    var html = template(data);    $(#result-section).html(html);    $(#result-section).fadeIn('fast');}$(#input-box).bind('input',function(event) {        $(#result-section).fadeOut('fast');});$(#input-box).keyup( function(event) {    var input_num = $(#input-box).val();    if (input_num.match(^0b)){        bin_num = input_num.slice(2);        if (!(/^[0|1]+$/.test(bin_num))){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else {            $(#input-box-form).removeClass(has-error);            $(#generate-button).prop('disabled',false);        }    } else {        bin_num = (+input_num).toString(2);        if( input_num.length == 0 ){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else if (isNaN(bin_num)){            $(#input-box-form).addClass(has-error);            $(#generate-button).prop('disabled',true);        } else {            $(#input-box-form).removeClass(has-error);            $(#generate-button).prop('disabled',false);        }    }});$(#input-box-form).submit( function(event) {    event.preventDefault();    var data = getParityData();    showParityData(data);});
Parity Bit Generator Webpage
javascript;jquery;html