CODE: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>page</title> <style> body { padding: 0; margin: 0; font-family: Arial; background: #262626; } .container { width: 500px; height: 180px; background-color: #d7d7d7; border-radius: 10px; padding: 20px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); } input[type="text"] { width: 460px; padding: 4px; margin:8px; } input[type="button"] { cursor: pointer; padding:... Continue Reading →
JavaScript Calculator(radio button)
HTML CODE <div class="box"> <h2>calculator</h2> <input type="text" id="number1" placeholder="number1"/><br> <input type="text" id="number2" placeholder="number2"/><br> <label><input type="radio" id="rad1" name="same" />Collection<br></label> <label><input type="radio" id="rad2" name="same" />Extraction<br></label> <label><input type="radio" id="rad3" name="same" />Multiplication<br></label> <label><input type="radio" id="rad4" name="same" />Division<br></label> <input type="button" id="but" value="calculate" /> <div id="res"></div> </div> CSS CODE: body{ margin:0; padding:0; background:#262626; text-transform:uppercase; font-family:'AR JULIAN'; font-size:14px; } h2{ font-size:28px; padding:0;... Continue Reading →
Object Inside Function
JavaScript object properties can also be defined as functions and is a widely used way. var calculate = { collection: function (n1, n2) { return n1 + n2; }, extraction: function (n1, n2) { return n1 - n2; }, pow: function (n1, n2) { return n1 * n2; }, division: function (n1, n2) { return... Continue Reading →