Tag: jquery ajax

How to Create Dynamic Dependent select box using ajax

How to Create Dynamic Dependent select box using ajax

You need a dynamic dependent select box. We will explain how to create a dynamic dependent select box in PHP, jquery and ajax.

index.php

<?php
include_once 'dbconfig.php';
?>
<html>
<head>
<title>Dynamic Dependent Select Box using Ajax</title>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<script 
hide

How to use Hide and Show Function using jQuery

in this article, you will learn How to use Hide and Show Function using jQuery. Using hide or show function you can hide or show any content in HTML document.

Example:-

<html>
<head>
<title>Hide Show Function</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  
ajax javascript

How to Create Callback Function in jQuery

In this article, you will learn How to Create Callback Function in jQuery.

Example:-

<html>
<head>
<title>Callback Function in jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").hide("slow", function(){
      alert("The paragraph is now hidden");
    });
  });
});
</script>
</head>
<body>
<button>Click 
jquery ajax

How to Create Get Content and Attributes in jQuery

In this article, you will learn How to Create Get Content and Attributes in jQuery.

Get Content

  • text()
  • html()
  • val()

Example:-

<html>
<head>
<title>Get Content</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#btn1").click(function(){
    alert("Text: " + $("#test").text());
  });
  $("#btn2").click(function(){
    alert("HTML: " + 
append

How to Add New HTML Content using jQuery

In this article, you will learn How to Add New HTML Content using jQuery. Four jQuery Methods for add new content.

  • append()
  • prepend()
  • after()
  • before()

jQuery append() method

<html>
<head>
<title>jQuery append() Method</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#btn1").click(function(){
    $("p").append("