jQuery, get ID of each element in a class using .each?

Try this, replacing .myClassName with the actual name of the class (but keep the period at the beginning). $(‘.myClassName’).each(function() { alert( this.id ); }); So if the class is “test”, you’d do $(‘.test’).each(func…. This is the specific form of .each() that iterates over a jQuery object. The form you were using iterates over any type … Read more

Get multiple elements by Id

If you can change the markup, you might want to use class instead. HTML <a class=”test” name=”Name 1″></a> <a class=”test” name=”Name 2″></a> <a class=”test” name=”Name 3″></a> JS var elements = document.getElementsByClassName(“test”); var names=””; for(var i = 0; i < elements.length; i++) { names += elements[i].name; } document.write(names); jsfiddle demo

How to count items in JSON data

import json json_data = json.dumps({ “result”:[ { “run”:[ { “action”:”stop” }, { “action”:”start” }, { “action”:”start” } ], “find”: “true” } ] }) item_dict = json.loads(json_data) print len(item_dict[‘result’][0][‘run’]) Convert it in dict.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)