موقع الرياضيات العربية أون لاين

أ. محمد عبدالمنعم الملط
مؤسس الموقع يرحب بكم
فى
موقع الرياضيات العربية أون لاين
أشهر مواقعى
www.mathtech.co.nr



انضم إلى المنتدى ، فالأمر سريع وسهل

موقع الرياضيات العربية أون لاين

أ. محمد عبدالمنعم الملط
مؤسس الموقع يرحب بكم
فى
موقع الرياضيات العربية أون لاين
أشهر مواقعى
www.mathtech.co.nr

موقع الرياضيات العربية أون لاين

هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

برمجيات الرياضيات لجميع المراحل التعليمية


    If...else if...else Statement

    Admin
    Admin
    Admin


    عدد المساهمات : 100
    تاريخ التسجيل : 16/02/2011

    If...else if...else Statement Empty If...else if...else Statement

    مُساهمة  Admin الثلاثاء فبراير 22, 2011 5:21 pm

    If...else if...else Statement
    Use the if....else if...else statement to select one of several blocks of code to be executed.

    Syntax
    if (condition1)
    {
    code to be executed if condition1 is true
    }
    else if (condition2)
    {
    code to be executed if condition2 is true
    }
    else
    {
    code to be executed if condition1 and condition2 are not true
    }

    Example
    <script type="text/javascript">
    var d = new Date()
    var time = d.getHours()
    if (time<10)
    {
    document.write("<b>Good morning</b>");
    }
    else if (time>10 && time<16)
    {
    document.write("<b>Good day</b>");
    }
    else
    {
    document.write("<b>Hello World!</b>");
    }
    </script>


      مواضيع مماثلة

      -

      الوقت/التاريخ الآن هو الخميس مارس 28, 2024 12:16 pm