JS练习源码01_使用Javascript语言实现表单交互
问题描述: 界面: 交互: 源码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> p { font-family : 宋体 ; font-size : 20px ; font-weight : bold ; } input,select { border-color : #87CEFA ; border-width : 1px ; padding : 2px ; } </style> <script language="javascript"> function func() { var price = parseInt ( document.myform.price.value ) ; var number = parseInt ( document.myform.number.value ) ; var str = document.myform.way_of_pay.value ; var discount =0 ; switch(str) { case "bank" : discount = 0.6 ; break ; case "phone" : discount = 0.7 ; break ; case "postpay" : discount = 0.8 ;