views:

23

answers:

1

Hi all,

After working in good ole' c++ all day, I like to have a few javascript/jQuery side projects that are purely for fun. One of most intriguing things about jQuery is the ease of filling forms. All you need is a selector and the .val() method and you are golden. However, what would be the most efficient way to fill forms across multiple sites? The form elements would have different selectors obviously. So is there a way to have a script inspect a page and determine the selectors needed, then hand those selectors to jQuery for filling?

Just an intriguing thought, probably not possible, but I thought I'd ask anyway, if only to satisfy my curiosity. So is something like I described above possible? Dynamically getting the selectors off of a page?

Thanks!!

+1  A: 

Assuming you're doing something like making an extension and not trying to do some cross-domain scripting (which won't work btw), the HTML should still be the same across sites.

You can select $('textarea'), $('select'), $('textfield'), $('input') etc, without worrying about things like classes and IDs.

Mark
FF extension, if I were to do anything.
Alex