Wednesday, May 9, 2018

pure javascript click by id

Here i give you code of pure javascript.

You can add any event by id.

Simple, copy and post this code in any file and you will get result.

<button id="chirag">Button 1</button> <br>
<button id="2">Button 2</button> <br>
<button id="3">Button 3</button> <br>

<script type="text/javascript">
var reply_click = function()
{
    alert("Button clicked, id "+this.id+", text"+this.innerHTML);
}
document.getElementById('chirag').onclick = reply_click;
document.getElementById('2').onclick = reply_click;
document.getElementById('3').onclick = reply_click;
</script>




Monday, March 12, 2018

database upload with cmd

Here I explain how to upload database with cmd.

First create database in phpmyadmin. For example ahd_db1

Now copy your sql file and paste in this path : MySql/bin

for example your sql file is db.sql so paste it xampp/MySql/bin/db.sql

Now run this command :

D:\xampp\mysql\bin>mysql -uroot ahd_db1< db.sql

Wait for some time. If execution ncompleted than it will display noraml cmd. For cross check go to phpmyadmin and check your database.