Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

Select Removing all option enter new values using Javascript Object

Select Removing all option enter new values using Javascript Object

Sometimes We face some problem How can i dynamically remove all options of a drop down box in javascript? How to reset Select box all option and enter new values ? How to create dynamic dropdown from javascript Object if you don’t want to use any database.

In this tutorial I will show an example how to do this in a easy way, you can even copy paste and create a filename.html and open in browser

First we need two dropdown, When we select an option from First One(that will hold some class like VI and VII [CBSE]), Sencond drodown will show related mathematics topic/lession to related Class

Removing all option of dropdown and enter new values using Javascript Object

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8"/>
<title>Creating dynamic Dropdown using Javascript Object</title>
<h1>Creating dynamic Dropdown using Javascript Array</h1>
<label>First Drop Down</label><br/>
<select name="student_class" id="student_class" class="change form-control" required>
<option value="">Select a Class</option>
<option value="VI">VI</option>
<option value="VII">VII</option>
<label for="">Topics</label><br/>
<select name="topic" id="topic" class="form-control" required>
<option value="">Select a Topic</option>
<!--Jquery CDN -->
<script src=""></script>
<!--Jquery CDN -->
var className=$("#student_class").val();
var cobj;
cobj ={'Knowing Your Numbers':'Knowing Your Numbers','whole Numbers':'whole Numbers','Playing with Numbers':'Playing with Numbers','Basic Geometric Ideas':'Basic Geometric Ideas','Understanding Elemetary shapes':'Understanding Elemetary shapes',
'Integers':'Integers','Fractions':'Fractions','Decimals':'Decimals','Data Handling':'Data Handling','Mensuration':'Mensuration','Algebra':'Algebra','Ration and Proportions':'Ration and Proportions','Symmetry':'Symmetry','Practical Geometry':'Practical Geometry'
}else if(className=="VII"){
cobj = {'Integers' : 'Integers','Fractions and Decimals' : 'Fractions and Decimals','Data Handling' : 'Data Handling','Simple Equations' : 'Simple Equations','Lines and Angles' : 'Lines and Angles','The Triangle and its Properties' : 'The Triangle and its Properties'
,'Congruence of Triangles' : 'Congruence of Triangles','Comparing quantities' : 'Comparing quantities'};
}else if(className=="VIII"){
cobj = {ValueA : 'Text A',ValueB : 'Text B',ValueC : 'Text C',ValueD : 'Text D',ValueE : 'Text E',ValueF : 'Text F'};
}else if(className=="IX"){
cobj = {ValueA : 'Text A',ValueB : 'Text B',ValueC : 'Text C',ValueD : 'Text D',ValueE : 'Text E',ValueF : 'Text F'};
}else if(className=="X"){
cobj = {ValueA : 'Text A',ValueB : 'Text B',ValueC : 'Text C',ValueD : 'Text D',ValueE : 'Text E',ValueF : 'Text F'};
var select = document.getElementById("topic");
//removing previous option
while (select.firstChild) {
// generating option based onclick
for(index in cobj) {
select.options[select.options.length] = new Option(cobj[index], index);

Infinix Hot 8 specification, pros and cons

Infinix Hot 8 specification, pros and cons

Infinix Hot 8 the cheapest and best phone as per specification going for flash sale on Flipkart from 12th September, 2019. In this post I will discuss specification, pros and cons of Infinix Hot 8, price and other details.

Before buying any smart phone Indian customer first think about its Camera quality, Battery Backup , performance and then build quality and other details.  Infinix hot 8 priced Rs. 6999 packed with Mediatek P22 SOC, 4GB RAM, 64GB ROM and around 6.52 inch  HD+ display.


Infinix Hot 8 Specification, Antutu Score  and pros and Cons

Specification Remarks
ANTUTU SCORE Around 82K Good
PubG Can be played in low graphic Not a PubG Device
SOC Mediatek Helio P22 (12nm) Good and Power Efficeient
RAM and ROM 4GB RAM 64GB ROM Excellent
Battery 5000mAH Excellent
Display 6.52 inch HD+, Good
Camera Primary 13MP + 2MP with quad LED, Secondary 8MP with AI get get better quality images
Dual Active VoLTE Yes can run two jio sim ..
Bluetooth  version 5 Excellent
FM Radio Yes
Sensor Fingerprint, G-sensor, Proximity, Light, Compass
Sound Dirac surround sound

Infinix hot 8 conclusion

Infinix Hot 8 is recommended device to buy as no company is providing such specification at this price its better than real me c2, Redmi 7A …

Write a Java Program to reverse an Array elements

Write a Java Program to reverse an Array elements

Write a Java Program to reverse an Array elements . In this post we will create a  Java code that will reverse an Array elements. Create a File using your favorite  editor I am using Geany (Kubuntu 18.04 LTS). Compile and run the code give below you will able to see the output given in the screenshot.

Screen shot

import java.util.Scanner;
class ReverseArray
public static void main(String args[])
int i,n,temp;

Scanner in=new Scanner(;
System.out.println("Enter a range: ");
int a[]=new int[n];
System.out.println("Enter Elements: ");
System.out.println("Invalid Entry");
a[n -1 - i]= temp;
System.out.print(" "+a[i]);

How to root Android using Linux Fastboot Mode

How to root Android using Linux Fastboot Mode

This Post is about root any almost any any android smart phone, Follow the steps given below to root an android device using Fastboot :

Requirement for Rooting Android Smart phone using Fastboot

  1. Device Drivers ADB FASTBOOT (Required)
  2. Custom Recovery for your Smart phones TWRP recommended (Required)
  3. Magisk (optional for root Management)
  4. Enable Developer Option and check USB Debugging On (Required)

Where to find TWRP, Custom ROM for my Device

Search TWRP or Custom Rom from your Device on XDA forum or Need Rom

Risk to Brick Smartphone

Unlocking Bootloader, Rooting your device can brick / damage your phone, you may loose device warrenty, do it at your own Risk.

Install ADB and FAST BOOT On Linux

For Ubuntu Type
sudo apt install adb

For Fedora Type
sudo yum install android-tools

Rooting a Phone Via Fastboot

  1. Install drivers
  2. Switch Off Phone and Press
    => Power On + Volume Down button
  3. Use Fast boot command

fastboot devices
fastboot oem unclock
fastboot flashing unlock
fastboot recovery.img
fastboot reboot

Note : Keep recovery.img(TWRP) in same folder or use command cd to that directory
then run fastboot recovery.img

If you want to go to Recovery then Switch Phone and Press Power On + Volume Up button

Create your own WordPress Functions.php File

Create your own WordPress Functions.php File

If someone want to create a custom WordPress Theme then functions.php is the most important file. For creating a WordPress Theme, we have to at least some files listed below :

  • style.css
  • index.php
  • functions.php
  • header.php
  • footer.php
  • page.php

Above listed files are minimum requirement for and WordPress Custom Theme. Today I will show how to create a functions.php, how to enqueue Style Sheets(CSS) and JavaScript, adding featured image support, excerpt length change and so on….

Creating functions.php with Bootstrap 4 CDN files, also we will keep CSS and JavaScript file in footer, so as per google content will load first and then others files, it will also add some good reputation on search engine’s eye.

//loading css files in footer
add_action( 'get_footer', 'load_styles' );
function load_styles() {
wp_enqueue_style( 'style', get_stylesheet_uri(), false );
wp_enqueue_style( 'bootstrap', "", false );
wp_enqueue_style( 'main', get_template_directory_uri()."/css/main.css", false );

//loading Js file in footer also
function load_js(){

wp_register_script( 'Jquery','','','', true );
wp_register_script( 'Popper','','','', true );
wp_register_script( 'Bootstrap', '','','', true );
wp_register_script( 'Main', get_template_directory_uri()."/js/main.js",'','', true );

wp_enqueue_script( 'Jquery' );
wp_enqueue_script( 'Popper' );
wp_enqueue_script( 'Bootstrap' );
wp_enqueue_script( 'Main' );

//Feature image
add_theme_support( 'post-thumbnails' );
//creating thumbnail footer-thumb size 64X64
add_image_size( 'footer-thumb', 64, 64, false );
//creating thumbnail thumb128 size 128X128
add_image_size( 'thumb128', 128, 128, false );
//Custom length excerpt
function custom_excerpt_length( $length ) {
return 40;//set custom value instead of 40
function new_excerpt_more($more) {
global $post;
add_filter('excerpt_more', 'new_excerpt_more');
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

// Site Logo using Cutomizer
add_action( 'customize_register', 'sp_customize_register' );
function sp_customize_register( $wp_customize ) {

$wp_customize->add_section( 'sp_logo' , array(
'title' => __( 'Site Logo', 'sp' ),
'description' => 'Modify the site logo image'
$wp_customize->add_setting( 'site_logo' , array(
'default' => ''
$wp_customize->add_control( new WP_Customize_Image_Control(
'label' => __( 'Upload Site Logo', 'sp' ),
'section' => 'sp_logo',
'settings' => 'site_logo'

Token, Compiler and Interpreter C Tutorial

Token, Compiler and Interpreter C Tutorial

Token :  A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol.

C language Supports Six Types of Tokens:

  1. Identifiers (Identifiers are names given to different names given to entities such as constants, variables, structures, functions etc.)
  2. Keywords (C has 32 reserved keywords)
  3. Constants (Constants are like a variable, except that their value never changes during execution once defined)
  4. Strings (The string can be defined as the one-dimensional array of characters terminated by a null (‘\0’).
  5. Operators (C operators are symbols that are used to perform mathematical or logical manipulations like =,>=,+,/,* ….)
  6. Special Symbols

For example, the following C statement consists of five tokens −

printf(“Hello, World! \n”);

  1. printf
  2. (
  3. “Hello, World! \n”
  4. )
  5. ;

Compiler :  A computer program which converts a program written in high level language (Source Language) to low level language (Object/Target/Machine Language).

Interpreter :  In computer science, an interpreter is a computer program that directly executes, i.e. performs, instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program.

The difference between an interpreter and a compiler

Interpreter Compiler
Translates program one statement at a time. Scans the entire program and translates it as a whole into machine code.
It takes less amount of time to analyze the source code but the overall execution time is slower. It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
No intermediate object code is generated, hence are memory efficient. Generates intermediate object code which further requires linking, hence requires more memory.
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.
Programming language like Python, Ruby, Java use interpreters. Programming language like C, C++, Java use compilers.


Computer Science with Python Installation Video Tutorial

Computer Science with Python Installation Video Tutorial

Recently CBSE changed Computer Science with C++ with Computer Science with Python for Class XI and XII starting from Session Year 2019-2020. This Tutorial will teach you how to install Python 3.73 on Windows 7 or Windows 10.

In this video I have used Windows 7 but process is same for windows 10. Remember Python 3.5+ not supported on Windows XP so please avoid XP, use windows 7, 10 or Linux.

After watching the video given below you will learn :

  • Installation of Python 3.x on Windows 7 / Windows 10
  • Python 3.X installation Setting the environment variable for Python and PIP
  • Coding using IDLE
  • Creating a BMI Calculator using notepad and run using the terminal BMI Calculator code can found at

ITBP Recruitment 2019 121 Vacancy Constable General Duty

ITBP Recruitment 2019 121 Vacancy Constable General Duty

ITBP (Indo-Tibetan Border Police Force) announced applications for the post of Constable for General Duty. Total number of vacancy is 121. One can Apply Online but before 21 June 2019.

ITBP Recruitment Qualification eligibility Criteria

All details for Recruitment of Constable ITBP Recruitment ( General Duty, Sports Quota) is given below

Name of Post Constable ( General Duty, Sports Quota)
Total number of Vacancy 121
Age Limit 18 to 23 years
Qualification 10th
Pay Scale 21,700/- (Per Month)
Job Location All India
Last Date of Application 21st June 2019
Where to get more detail Visit IBTP Official Website for more Details

JavaScript tutorial Simple Addition

JavaScript tutorial Simple Addition

In this tutorial we are going to learn JavaScript simple addition through input text box, complete code is given below and code is easy to understand , still if you find any kind of difficulty then please comment, I will try to clear you …

JavaScript Simple Addition Code  / Script:

<!DOCTYPE html>
<html lang="en">
<title>JavaScript Simple Addition</title>
<meta charset="utf-8"/>
JavaScript Simple Addition
Tutorial by Sanjay Sir ( Codentricks )

<input type="text" id="num1" />
<input type="text" id="num2" />
<input type="submit" onclick="sum()" value="Submit" />
<div id="result"></div>

function sum(){
var num1=parseFloat(document.getElementById("num1").value);
var num2=parseFloat(document.getElementById("num2").value);
var sum;


JavaScript Simple Addition Demo

West Bengal WBBSE Madhyamik Result 2019 Date on 21st May 9am Onwards

West Bengal WBBSE Madhyamik Result 2019 Date on 21st May 9am Onwards

West Bengal WBBSE Madhyamik Result 2019 Date and Time – 21st May 9 am, WBBSE class 10th Result for the year 2019 by The West Bengal Board of Secondary Education (WBBSE) is going to declare on 21st May 9 am onwards, but students can access result after 10am, its just two days before the announcement of the results of the election on 23rd May. This effect is being done in 88 days.

Students can check their result on the official websites given below

West Bengal Madhyamik Class 10 Result 2019: Steps to check score via SMS
Sent a SMS in the below pattern-
WB10, followed by the roll number and send it to 54242/56263/58888.

A total of 10.66 lakh students appeared for the Madhyamik exams, which were conducted between 12 and 22 February. While In the year 2018, Class 10 results were announced on 6 June. The overall pass percentage was 85.49 percent. More than 11 lakh students had appeared for the exams last year.

Do you have any Query / Suggestion