Macro for Web Page

I want to use a excel macro to fill in the form in a webpage  for the data in excel.
However, I can't locate the field name or field id as it will be changed everytimes when I log into the web page.
Is there any way to locate the field base on the page location?


use parent element to locate your target element
e.g your target element is a input element
<div id=grandparent><div id=parent><input id=randomid/></div></div>

$('#grandparent #parent input')