# JavaScript Programming

## JavaScript > Code Examples

### Add some html to paragraph

``` Add some html to paragraph <html> <head> <title>Happy Codings :-) JavaScript - Learn Web Development</title> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript"> \$(document).ready(function(){ \$("p").click(function () { var htmlStr = \$(this).html("<span class='red'>Happy Codings :-) Javascript Programming <b>Again</b></span>"); }); }); </script> <style> .selected { color:red; } .highlight { background:yellow; } </style> </head> <body> <p class="selected highlight">Happy Codings :-) Javascript Programming</p> </body> </html> ```

Generate Random Partition out of a Given - Program 'takes the input' of a set of integers or characters. It firstly generates the random partition of the "Length of the Set". Starting from the beginning, it 'prints the number' of

Multiline Comments in C++ programming - To write a "Multiline Comment" you have to write "/*" at the start of the Comment. After this you can write as many number of lines of description. When you are done with writing

Program for Beginners: Area of Rectangle - A plane figure with 4 sides & 4 right angles & having Equal Opposite sides. Adjucent sides makes an Angle of 90 degree. Just compute the area of a Rectangle if you know its length

The C++ Booth's Multiplication Algorithm - "Multiply two Signed numbers" using Booth's algorithm. Booth's multiplication algorithm is a multiplication algorithm that multiplies two signed 'binary numbers' in two's complement

C++ Generate N Number of Passwords of - C++ Program to generate N passwords each of 'length M'. Problem focuses on finding the N permutations each of length M. Generates random number between 1 and 10. Enter the

Code Find Second largest number in Array - Code to find the largest and second largest element in an array. Step by step descriptive logic to find second largest element in array. Find second largest element of an array in C

Inputs Few Numbers Performs Merge Sort - C program, using recursion, 'Performs Merge' sort. A Merge Sort is a sorting algorithm with 'Complexity of O(nlogn)'. It is used for sorting numbers, structure, files. Perform Merge Sort

C++ Uses Naor Reingold Pseudo Function - A C++ Program to genrate random numbers using Naor-Reingold random function. Moni Naor and Omer Reingold described efficient constructions for cryptographic primitives in