WEB DESIGN GARAGE [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

WEB DESIGN GARAGE [Electronic resources] - نسخه متنی

Marc Campbell

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Working with Generic Buttons


Generic buttons (see Figure 68.1) are clickable, but they don't do anything when the visitor clicks them, unlike submit and reset buttons. You must specifically program these buttons to do what you want them to do, which is usually to launch a JavaScript function. The button's input tag takes the onClick event, where you put the name of the function that you want to launch.

Listing 68.1. View Source for Figure 68.1.


<form>
<input type="button" name="totalButton" value="Calculate Total" onClick="doTotal();">
</form>

Figure 68.1. A generic button is clickable, but it doesn't do anything until you add an onClick event to its tag.

[View full size image]

The name attribute of the button's input tag identifies the button, and the value attribute contains the label that appears on the button's face. The value of the onClick event is the name of the JavaScript function that launches when the visitor clicks the button.


/ 175