hess-select-profile
Version:
Select a given profile value on the hess energy website https://hessenergy.com
24 lines (22 loc) • 601 B
JavaScript
var inspect = require('eyespect').inspector();
module.exports = function ($) {
var select = $('select#ctl00_MainContentPlaceHolder_ucLeftNavigation_ddlProfile')
if (select.length === 0) {
return null
}
var options = select.children('option')
var selectedOptions = options.filter(function () {
var option = this
var selected = option.attr('selected')
return selected
})
if (selectedOptions.length === 0) {
return null
}
if (selectedOptions.length > 1) {
return null
}
var option = $(selectedOptions[0])
var value = option.attr('value')
return value
}