# Finding dynamic Div tag using its innertext

**URL:** <https://www.ruby-forum.com/t/finding-dynamic-div-tag-using-its-innertext/187383>\
**Category:** Ruby\
**Created:** [April 22, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/finding-dynamic-div-tag-using-its-innertext/187383 "2010-04-22T12:15:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simbolla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@simbolla](https://www.ruby-forum.com/u/simbolla)\
**Post date:** [April 22, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/finding-dynamic-div-tag-using-its-innertext/187383/1 "2010-04-22T12:15:30Z")

</div>

Hi all,

I am using watir , in that have a scenario where they change a innertext  
of div tag using javascript.Some thing like  
Onclick of button they change innertext of div tag. I want to find that  
dynamic div tag using the innertext (Inner text will be known & it’s  
expected result),please some body tell how to solve this problem.

Note : Dynamic Div tag means they are generating div tag using  
javascript at runtime.

thanks  
Vinod

---

<div class="post-metadata">

**Author:** ![simbolla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@simbolla](https://www.ruby-forum.com/u/simbolla)\
**Post date:** [April 23, 2010, 2:57am UTC](https://www.ruby-forum.com/t/finding-dynamic-div-tag-using-its-innertext/187383/2 "2010-04-23T02:57:19Z")

</div>

browser.div(:text, ‘dynamic text’).

On Thu, Apr 22, 2010 at 5:18 AM, Simbolla S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> ## thanks Vinod
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
Bret P.  
Lead Developer, Watir, [www.watir.com](http://www.watir.com)

Blog, [www.io.com/~wazmo/blog](http://www.io.com/~wazmo/blog)  
Twitter, [www.twitter.com/bpettichord](http://www.twitter.com/bpettichord)

---

<div class="post-metadata">

**Author:** ![simbolla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@simbolla](https://www.ruby-forum.com/u/simbolla)\
**Post date:** [April 23, 2010, 10:45am UTC](https://www.ruby-forum.com/t/finding-dynamic-div-tag-using-its-innertext/187383/3 "2010-04-23T10:45:36Z")

</div>

Bret P. wrote:

> browser.div(:text, ‘dynamic text’).
> 
> On Thu, Apr 22, 2010 at 5:18 AM, Simbolla S.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:
> 
> > ## thanks Vinod
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> –  
> Bret P.  
> Lead Developer, Watir, [www.watir.com](http://www.watir.com)
> 
> Blog, [www.io.com/~wazmo/blog](http://www.io.com/~wazmo/blog)  
> Twitter, [www.twitter.com/bpettichord](http://www.twitter.com/bpettichord)

Thanks Bret for the fast response. i used another way to solve it

ie.text.include? str
