Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get attribute value #12

Open
Err0r404 opened this issue Mar 23, 2014 · 1 comment
Open

Get attribute value #12

Err0r404 opened this issue Mar 23, 2014 · 1 comment

Comments

@Err0r404
Copy link

Hi,

I'm using Gargl and it's awesome !
However I have a question : is there any way to get attribute value of an element ?

For exemple get the "href" value ?

Thanks !

@jodoglevy
Copy link
Owner

Hi,

We don't currently support having anything other than innerHTML of an element returned for a response field.

The correct behavior should be to return the innerHTML for a response field that is not of type input or textarea. For input or textarea return the value property instead. We should also have an attribute capability that lets you say instead of the innerHTML or value, you want the value of a certain attribute of an element returned for a response field. But we don't support any of this right now. Feel free to submit a pull request supporting this functionality :)

The workaround would be to provide the css selector for the parent of the element you want the attribute value for, and then parse this parent's innerHTML for the attribute of the child element you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants