Category Archives: Javascript

Set html in all elements having same ids using Jquery

  //sets html in all ids across the page $(’[id^="'+id+'"]‘).html();

Posted in Javascript, Jquery

Get values inside JavaScript object

  //data is javascript object with unknown ids   //This loop with fetch all index name as well as their values for (var i in data) { alert(’theStatus[\''+i+'\'] is ‘ + data[i]) }

Posted in Javascript

Set value in radio using jquery

$(“input:radio[name='name'][value=1]“.attr(‘checked’, true);

Posted in Javascript, Jquery

Jquery autocomplete with multiple data

$("#Query").autocomplete({ source: [{ label: ‘My First Item’, value: ‘/items/1′ }, { label: ‘My Second Item’, value: ‘/items/2′}] ,focus: function (event, ui) { $(event.target).val(ui.item.label); return false; } ,select: function (event, ui) { $(event.target).val(ui.item.label); window.location = ui.item.value; return false; } });

Posted in Javascript Tagged ,

using text instead of convencial submit button

If we want to submit form using text instead of convencial submit button then follow the article. We’ve have to use following javascript code on click event. document.formname.submit() For Example: <form action=’newsletter/index’ name=’newsletter’> <input type="text" name="email" class="smalltxt" /><br /> <a … Continue reading

Posted in Javascript

Highlight current element using javascript

Adding dyamic current link style using javascript. It makes easy to view where we are in website. I’m talking about when you are at home and home looks different from others. How can one achieve that without even using server … Continue reading

Posted in Featured, Javascript Tagged