If you want to set the same action for several elements, you can write IDs of elements separated by comma. This way:
If you want to set the same action for several elements, you can write IDs of elements separated by comma. This way:
It took me some time to get the index of selected value of <select> html control. I tried to use 'attr', but 'prop' should be used for this.
Tables with at least 20 rows are more readable when its rows look like stripes – even row in one color, odd one in another. Before jQuery we used to add class to each row of table, we made "<tr class="even"> …</tr>" and "<tr class="odd"> …</tr>". Now it’s much easier to do using jQuery. (read more...)
Below I described two string javascript functions that I often forget. (read more...)
This code disables context menu, cutting, copying and dragging text. Sometimes you need it. Just add the code to a page or to .js file and include it to a page.
When you have a table which you can’t edit, you think you can’t do anything with it. It may be a result of an outside procedure or web-service (usually it returns data in XML, but html-table also can be).
So, for example, we have a list of Borussia Dortmund players. We know id in list, Name of player, his Lastname and date of birth (Figure 1). (read more...)