jQuery Tutorial for hide p tag
Last Updated on Sunday, 28 February 2010 15:29 Written by Zack Sunday, 28 February 2010 14:42
ဒီပထမဆံုး Tutorial ေလးမွာအလြယ္ဆံုးေသာဥပမာေလးနဲ႕ပဲစလိုက္ပါမယ္။ html ရဲ႕ <p> tag ထဲမွာေရးထားတဲ့ဟာေတြ
အားလံုးကို hide လုပ္မွာျဖစ္ပါတယ္။
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>
</body>
</html>
ဒီ example ေလးမွာ click me ဆိုတဲ့ buttom ေလးကို click လိုက္ရင္
$("button").click(function(){
$("p").hide();
});
ဆိုတဲ့ code က RUN ျပီး <p>......</p> ႏွစ္ခုၾကားမွာရွိေသာ text ေတြအားလံုးကို hide လုပ္ေပးမွာျဖစ္ပါတယ္။
အရမ္းကိုရိုးစင္းျပီးလြယ္ကူတဲ့ example ေလးတစ္ခုပဲျဖစ္ပါတယ္။ ဒီမွာ test လုပ္ၾကည့္နိုင္ပါတယ္။ ဒီ example ေလးရဲ႕
source code ကို download လုပ္နိုင္ပါတယ္။ ဒီ example ကို w3school ကေနျပီး reference လုပ္ထားတာျဖစ္ပါတယ္။
Ref: http://www.w3schools.com/jquery/jquery_intro.asp
| < Prev | Next > |
|---|
Login Form
Latest Post
Categories Table View
- Reader's Conner (133)
- PHP (48)
- Joomla CMS (46)
- Codeigniter (18)
- jQuery (12)
- iDhamma (11)
- Mobile Development (10)
- PHP & AJAX (4)
- Apache (3)
- For Mac (3)
- mySQL (2)
- DhammaDroid (1)