# PHP - Retrieve html tags based on id

**URL:** <https://forum.kirupa.com/t/php-retrieve-html-tags-based-on-id/244484>\
**Category:** programming\
**Created:** [November 19, 2007, 12:42am UTC](https://forum.kirupa.com/t/php-retrieve-html-tags-based-on-id/244484 "2007-11-19T00:42:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverType](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@silverType](https://forum.kirupa.com/u/silverType)\
**Post date:** [November 19, 2007, 12:42am UTC](https://forum.kirupa.com/t/php-retrieve-html-tags-based-on-id/244484/1 "2007-11-19T00:42:05Z")

</div>

Hi guys,

I was wondering if there is a way to retrieve html tag by suppling its id or name attribute? For eg. I have a textbox with ‘ferrari’ as its id. So whenever someone clicks on the textbox, its id will be submitted and the corresponding html tag ie. ‘\<input type=“text”\>’ will be returned. Any idea how this can be achieved? Thanks in advance.
