Fungsi JavaScript, atau yang sering disingkat JS, adalah menjadikan website lebih interaktif. Scriptnya dijalankan di browser user alih-alih server, dan biasanya masuk ke library pihak ketiga untuk menyediakan fungsionalitas tingkat lanjut tanpa mengharuskan developer melakukan coding dari awal.
PHP merupakan bahasa pemrograman server-side, sedangkan JavaScript adalah bahasa pemrograman yang dijalankan di client-side. Bahasa ini sering terlihat di sistem manajemen konten berbasis PHP, misalnya WordPress, tapi juga sering digunakan untuk pengembangan back-end karena menyediakan jalan terbaik guna memfasilitasi proses transfer informasi dari dan ke database. PHP merupakan kepanjang dari Program Hypertext Preprocessor.
Baiklah setelah tahu sedikit defenisi dari materi diatas, langsung saja kita lihat Contoh Soal Quiz Javascript, PHP, dan Bootstrap:
JAVASCRIPT
QUIZ
- Inside which HTML element do we put the JavaScript? <script>
- What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p> document.getElementById("demo").innerHTML = "Hello World!";
- Where is the correct place to insert a JavaScript? Both the <head> section and the <body> section are correct
- What is the correct syntax for referring to an external script called "xxx.js"? <script src="xxx.js">
- The external JavaScript file must contain the <script> tag. False
- How do you write "Hello World" in an alert box? alert("Hello World");
- How do you create a function in JavaScript? function myFunction()
- How do you call a function named "myFunction"? myFunction()
- How to write an IF statement in JavaScript? if (i == 5)
- How to write an IF statement for executing some code if "i" is NOT equal to 5? if (i != 5)
- How does a WHILE loop start? while (i <= 10)
- How does a FOR loop start? for (i = 0; i <= 5; i++)
- How can you add a comment in a JavaScript? //This is a comment
- How to insert a comment that has more than one line? /*This comment has more than one line*/
- What is the correct way to write a JavaScript array? var colors = ["red", "green", "blue"]
- How do you round the number 7.25, to the nearest integer? Math.round(7.25)
- How do you find the number with the highest value of x and y? Math.max(x, y)
- What is the correct JavaScript syntax for opening a new window called "w2" ? w2 = window.open("http://www.w3schools.com");
- JavaScript is the same as Java. False
- How can you detect the client's browser name? navigator.appName
- Which event occurs when the user clicks on an HTML element? onclick
- How do you declare a JavaScript variable? var carName;
- Which operator is used to assign a value to a variable? = =
- What will the following code return: Boolean(10 > 9) true
- Is JavaScript case-sensitive? Yes
PHP QUIZ
- What does PHP stand for? PHP: Hypertext Preprocessor
- PHP server scripts are surrounded by delimiters, which? <?php...?>
- How do you write "Hello World" in PHP? echo "Hello World";
- All variables in PHP start with which symbol? $
- What is the correct way to end a PHP statement? ;
- The PHP syntax is most similar to: Perl and C
- How do you get information from a form that is submitted using the "get" method? $_GET[];
- When using the POST method, variables are displayed in the URL: False
- In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings: True
- Include files must have the file extension ".inc" False
- What is the correct way to include the file "time.inc" ? <?php include "time.inc"; ?>
- What is the correct way to create a function in PHP? function myFunction()
- What is the correct way to open the file "time.txt" as readable? fopen("time.txt","r");
- PHP allows you to send emails directly from a script. True
- Which superglobal variable holds information about headers, paths, and script locations? $_SERVER
- What is the correct way to add 1 to the $count variable? $count++;
- What is a correct way to add a comment in PHP? /*...*/
- PHP can be run on Microsoft Windows IIS(Internet Information Server): True
- The die() and exit() functions do the exact same thing. True
- Which one of these variables has an illegal name? $my-Var
- How do you create a cookie in PHP? setcookie()
- In PHP, the only way to output text is with echo. False
- How do you create an array in PHP? $cars = array("Volvo", "BMW", "Toyota");
- The if statement is used to execute some code only if a specified condition is true? True
- Which operator is used to check if two values are equal and of same data type? ===
BOOTSTRAP QUIZ
- Bootstrap 3 is mobile-first. True
- Which class provides a responsive fixed width container? .container
- Which class provides a full width container, spanning the entire width of the viewport? .container-fluid
- The Bootstrap grid system is based on how many columns? 12
- Which class adds zebra-stripes to a table? .table-striped
- Which class shapes an image to a circle? .img-circle
- Which class is used to create a big box for calling extra attention? .jumbotron
- Which button class is used to create a large button? .btn-lg
- Which class is used to create a button group? .btn-group
- How can you insert a search icon? <span class="glyphicon glyphicon-search"></span>
- Which class is used to create a badge? .badge
- Which class is used to create a basic pagination? .pagination
- Which class is used to create a basic list group? .list-group
- Which class adds a heading to a panel? .panel-heading
- Which class indicates a dropdown menu? .dropdown
- A standard navigation tab is created with: <ul class="nav nav-tabs">
- A standard navigation bar is created with: <nav class="navbar navbar-default">
- Which class is used to create a black navigation bar? .navbar-inverse
- Which plugin is used to cycle through elements, like a slideshow? Carousel
- Which plugin is used to create a modal window? Modal
- Which plugin is used to create a tooltip? Tooltip
- Which contextual class indicates a succesful or positive action? .text-success
- Which contextual class indicates a dangerous or potentially negative action? .text-danger
- Which class indicates uppercased text? .text-uppercase
- The Bootstrap grid system works across multiple devices. True
Itulah contoh soal quiz mengenai Javascript, PHP, dan Bootstrap. semoga contoh soal quiz dan jawabannya tersebut dapan membantu kalian dalam menjawab soal dan menambah pengetahuan kalian. Terimakasih telah berkunjung, jangan lupa untuk selalu kunjungi fivser.com, sampai jumpa di artikel lainnya.