DeveloperBreeze

مكتبة Jquery Development Tutorials, Guides & Insights

Unlock 1+ expert-curated مكتبة jquery tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your مكتبة jquery skills on DeveloperBreeze.

مكتبة jQuery: استخدام JavaScript بسهولة وفعالية

Tutorial September 26, 2024
javascript

واحدة من أقوى ميزات jQuery هي التعامل مع الأحداث بسهولة. يمكنك استخدام العديد من الأحداث مثل "click"، "hover"، "keyup"، والمزيد.

<!DOCTYPE html>
<html lang="ar">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>حدث hover باستخدام jQuery</title>
</head>
<body>

    <div id="box" style="width: 100px; height: 100px; background-color: blue;"></div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
        $('#box').hover(
            function() {
                $(this).css('background-color', 'red');
            },
            function() {
                $(this).css('background-color', 'blue');
            }
        );
    </script>
</body>
</html>