I have the following form on my website
input a
input b
input c
Is it possible to have the following done using jQuery?
input a
input c
input b
Keep in mind that the form still needs to collect the data correctly.
Please advise.
Yes, that's possible, it's easier, albeit the same technique, with ids but if you just know which one you want to move, then:
$('input:text:nth-child(3)').insertAfter($('input:text:nth-child(1)'));
JS Fiddle of id-based approach (generously offered by Vega).
Or, similarly:
$('input:text:nth-child(3)').appendTo($('input:text:nth-child(1)').parent());
JS Fiddle demo of id-based approach.
References:
id-based demo. =)