עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

שימוש בVAL בJQuery

Featured Replies

פורסם


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR.xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head lang="en">
<meta charset="UTF-8">
<title>JQuery val</title>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"
type="text/javascript" >
</script>
</head>
<body>

<input type="text" id="num1" />
<input type="text" id="num2" />
<input type="button" id="bt" value="+" />
<input type="text" id="num3" />
<script>
$(document).ready(function(){
$("#bt").bind("click", function() {
var result = parseFloat($(#"num1").val()) + parseFloat($(#"num2").val());
$("#num3").val(result);
}
);
});
</script>
</body>
</html>

השורה של var result נותנת שגיאה של SYNTAX ERROR לפי הדפדפן

למה ???

פורסם

הסולמית צריכה להיות בתוך המרכאות, לא מחוץ למרכאות.

פורסם
  • מחבר

קודם כל תודה רבה.

מאותם רגעים שאתה אומר הנה שוווווווב עברתי על כל הקוד מאה פעם ולא שמתי לב

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.