HTML simple shopping quantity applet

HTML simple shopping quantity applet

This article shares a simple HTML shopping quantity applet for your reference. The specific content is as follows

XML/HTML CodeCopy content to clipboard
  1. < html >   
  2.     < head >   
  3.   
  4.        < title > Shopping quantity applet </ title >   
  5.   
  6.      < script >   
  7. function sub()
  8. {
  9.   
  10. var a = buy.ans.value ;
  11. //alert(a);
  12.              a = parseInt (a);
  13. a--;
  14. if(a < 0 )
  15.               a = 0 ;
  16.              buy.ans.value = a;
  17. }
  18. function add()
  19. {
  20. var a = buy.ans.value ;
  21.              a = parseInt (a);
  22. a++;
  23.              buy.ans.value = a;
  24. }
  25.          </ script >   
  26.   
  27.     </ head >   
  28.   
  29.     < body >   
  30.       < form   name = "buy" >   
  31. Purchase quantity < input   type = "button"    value = "-"   onclick = "sub()" >   
  32.              < input   type = "text"   name = "ans"   value = "1" >   
  33.              < input   type = "button"    value = "+"   onclick = "add()" >   
  34.   
  35.       </ form >   
  36.      </ body >   
  37. </ html >   
  38.   

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  MySQL Tutorial: Subquery Example Detailed Explanation

>>:  3 Tips You Must Know When Learning JavaScript

Recommend

Introduction to JavaScript conditional access attributes and arrow functions

Table of contents 1. Conditional access attribute...

Mysql slow query optimization method and optimization principle

1. For comparison of date size, the date format p...

MySQL 8.0.22 decompression version installation tutorial (for beginners only)

Table of contents 1. Resource download 2. Unzip t...

Usage and execution process of http module in node

What is the role of http in node The responsibili...

Div picture marquee seamless connection implementation code

Copy code The code is as follows: <html> &l...

HTML+CSS makes div tag add delete icon in the upper right corner sample code

1. Requirements description Display the delete ic...

VMware workstation 12 install Ubuntu 14.04 (64 bit)

1. Installation Environment Computer model: Lenov...

Top 10 Js Image Processing Libraries

Table of contents introduce 1. Pica 2. Lena.js 3....

A brief discussion on the correct approach to MySQL table space recovery

Table of contents Preliminary Notes Problem Repro...

Detailed explanation of js closure and garbage collection mechanism examples

Table of contents Preface text 1. Closure 1.1 Wha...

Vue+js click arrow to switch pictures

This article example shares the specific code of ...

Analysis of Nginx Rewrite usage scenarios and configuration methods

Nginx Rewrite usage scenarios 1. URL address jump...

Markup language - specify CSS styles for text

Click here to return to the 123WORDPRESS.COM HTML ...

What does the legendary VUE syntax sugar do?

Table of contents 1. What is syntactic sugar? 2. ...