Reputation: 626
Example:
<div id="xxx" style="width: 76px; height: 302px; z-index: 0; text-align: left;">
I would like watir-wedriver to change z-index: 0
to z-index: -1
automatically, otherwise I have to do that manually in Firebug while script is sleeping.
Upvotes: 2
Views: 2287
Reputation: 626
Thanks, Željko, for idea!
The code that does the trick in this case is
browser.execute_script("document.getElementById('xxx').style.zIndex='-1';")
Upvotes: 3
Reputation: 57262
You can execute any javascript with something like this:
browser.execute_script "javascript_code"
I am not a javascript expert so you will have to figure out that part yourself.
Upvotes: 3