How to Integrate Select2 for Dropdown or Select Box?

Using Select2 from a CDN

A CDN (content delivery network) is the fastest way to get up and running with Select2!

Select2 is hosted on both the cdnjs and jsDelivr CDNs. Simply include the following lines of code in the section of your page:

<link href="" rel="stylesheet" />

<script src=""></script>

Or, You Can Download the Library Files From directly SELECT2 Github

The precompiled distribution files will be available in vendor/select2/dist/css/ and vendor/select2/dist/js/, relative to your project directory. Include them in your page:

<link href="vendor/select2/dist/css/select2.min.css" rel="stylesheet" />

<script src="vendor/select2/dist/js/select2.min.js"></script>

Example: Single Select

<select class="js-example-basic-single" name="state">
  <option value="AL">Alabama</option>
  <option value="WY">Wyoming</option>

Select2 will register itself as a jQuery function if you use any of the distribution builds, so you can call .select2() on any jQuery selector where you would like to initialize Select2.

// In your Javascript (external .js resource or <script> tag)
$(document).ready(function() {

Example: Multi-select boxes

Select2 also supports multi-value select boxes. The select below is declared with the multiple attribute.

The HTML Content is Like,

<select class="js-example-basic-multiple" name="states[]" multiple="multiple">
  <option value="AL">Alabama</option>
  <option value="WY">Wyoming</option>

The Script Content within Script Tag

$(document).ready(function() {

For DEMO Examples, Please Visit:


This page isn’t working Chrome detected unusual code on this page and blocked it to protect your personal information. ERR_BLOCKED_BY_XSS_AUDITOR

This page isn't working
Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards).

This page isn’t workingERR_BLOCKED_BY_XSS_AUDITOR


This error message is occurs when we are trying to post a content with HTML tags or Scripts Tags or Like When Google Chrome believes a “cross-site scripting” attack is happening. These attacks happen when a browser is tricked into rendering HTML or JavaScript that is not meant to be a part of the website being displayed.

Then Chrome Generates This ERROR ”

For PHP and All Other PHP Frameworks: Add this below line before post


Python Interview Questions : Part-1

Q1. What is the difference between list and tuples?

Lists are mutable i.e they can be edited.Tuples are immutable (tuples are lists which can’t be edited).
Lists are slower than tuples.Tuples are faster than list.
Syntax: list_1 = [10, ‘Chelsea’, 20]Syntax: tup_1 = (10, ‘Chelsea’ , 20)

Q2. What are the key features of Python?

  • Python is an interpreted language. That means that, unlike languages like C and its variants, Python does not need to be compiled before it is run. Other interpreted languages include PHP and Ruby.
  • Python is dynamically typed, this means that you don’t need to state the types of variables when you declare them or anything like that. You can do things like x=111 and then x=”I’m a string” without error
  • Python is well suited to object orientated programming in that it allows the definition of classes along with composition and inheritance. Python does not have access specifiers (like C++’s public, private), the justification for this point is given as “we are all adults here”
  • In Python, functions are first-class objects. This means that they can be assigned to variables, returned from other functions and passed into functions. Classes are also first class objects
  • Writing Python code is quick but running it is often slower than compiled languages. Fortunately,Python allows the inclusion of C based extensions so bottlenecks can be optimized away and often are. The numpy package is a good example of this, it’s really quite quick because a lot of the number crunching it does isn’t actually done by Python
  • Python finds use in many spheres – web applications, automation, scientific modelling, big data applications and many more. It’s also often used as “glue” code to get other languages and components to play nice.

Resources: Edureka

How to Set a Domain name for xampp server project like:

If you want to give a domain name for your Xampp Project, YES! Here you Can do it easily… Just Follow the Below Steps-


Open Your XAMPP Folder, Where You Have Installed.

Then, Go to folder apache,

Then, Open Folder conf,

Then, Open Folder extra.

The Full Path is Like,

PATH::    C:\xampp\apache\conf\extra

Now, Open “httpd-vhosts.conf” in an Editor

FILE NAME:: httpd-vhosts.conf
open file named – httpd-vhosts.conf

Here, You can see the line of code, Like-

#Virtual Hosts
#Required modules: mod_log_config
#If you want to maintain multiple domains/hostnames on your
#machine you can setup VirtualHost containers for them. Most configurations
#use only name-based virtual hosts so the server doesn't need to worry about
#IP addresses. This is indicated by the asterisks in the directives below.
#Please see the documentation at

#for further details before you try to setup virtual hosts.
#You may use the command line option '-S' to verify your virtual host
#Use name-based virtual hosting.

#NameVirtualHost *:80
#VirtualHost example:
#Almost any Apache directive may go into a VirtualHost container.
#The first VirtualHost section is used for all requests that do not
#match a ##ServerName or ##ServerAlias in any block.

##ServerAdmin w[email protected]
##DocumentRoot "C:/xampp/htdocs/"
##ErrorLog "logs/"
##CustomLog "logs/" common

##ServerAdmin [email protected]
##DocumentRoot "C:/xampp/htdocs/"
##ErrorLog "logs/"
##CustomLog "logs/" common

Here, at the End of file just add the below code. here is your project domain name. You Can change it as you want..

ServerAdmin [email protected]
DocumentRoot "C:/xampp/htdocs/"
ErrorLog "logs/"
CustomLog "logs/" common


Now, Open your C drive’s – Windows Folder,

Then, Open System32 Folder,

Then, Open drivers folder,

Then, Open etc folder,

Here, you can find many files. From here Open “hosts” file in an Editor.

PATH::    C:\Windows\System32\drivers\etc
FILE NAME:: hosts

The hosts file content look like – 

Copyright (c) 1993-2009 Microsoft Corp.
#This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names.
#Each entry should be kept on an individual line.
#The IP address should be placed in the first column followed by the corresponding host name.
#The IP address and the host name should be separated by at least one
#Additionally, comments (such as these) may be inserted on individual
lines or following the machine name denoted by a '#' symbol.

#For example:
# # source server
# # x client host

#localhost name resolution is handled within DNS itself.
# localhost
#::1 localhost

# Newly Added Project Domain

Here, you can see newly added domain. It is the project domain which we have created in xammp folder in Step-1

Now, Restart your xampp,

Now you can access the project using the domain name.

Now , Just type your given domain name or, the project fill will open.

Finally Done.