|
O‘zbekiston respublikasi axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti qarshi filiali
|
bet | 8/8 | Sana | 05.01.2024 | Hajmi | 23,78 Kb. | | #130921 |
Bog'liq 3-amaliy ish Mavzu jquery selektorlar,hodisalar. Jquery ui-fayllar.orghtml>
<head>
<title>jQuerytitle>
<style>
button {
background-color: orange;
color: white;
border: 2px outset orange;
}
input, button {
outline: none;
}
#error {
color: red;
}
style>
<script sre="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous">script>
<script>
let onReady = function () {
jQuery('#error').hide();
jQuery('button').on('mousedown', function() {
jQuery(this).css('border-style', 'inset');
});
jQuery('button').on('mouseup', function() {
jQuery(this).css('border-style', 'outset');
let num1 = jQuery('#num1').val();
let num2 = jQuery('#num2').val();
num1 = Number(num1);
num2 = Number(num2);
if(isNaN(num1) || isNaN(num2)) {
jQuery('#error').fadeIn();
jQuery('#result').html(0);
} else {
jQuery('#error').fadeOut();
jQuery('#result').html(num1 + num2);
}
});
}
jQuery(onReady);
script>
head>
<body>
<input id="num1" type="text" size"5" />
<span>+span>
<input id="num2" type="text" size"5" />
<button type="button">=button>
<span id="result">0span>
<div id="error">Iltimos, raqam kiritingdiv>
body>
html>
Tayyorladi:_______________________________________Abdimo’minov.A
http://fayllar.org
|
|
Bosh sahifa
Aloqalar
Bosh sahifa
O‘zbekiston respublikasi axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti qarshi filiali
|