0

i need to check a checkbox in my webbrowser control the thing is this checkbox has no ID so i can't use the GetElementById() method

this is HTML code of the checkbox

<input type="checkbox" class="shoulduselikescheckbox" defaultchecked="true"  >
John Saunders
  • 160,644
  • 26
  • 247
  • 397
user3621917
  • 75
  • 1
  • 1
  • 7
  • You can try using xpath. See this link http://stackoverflow.com/questions/25355386/using-xpath-and-webbrowser-control-to-select-multiple-nodes – prem Dec 02 '14 at 13:48

1 Answers1

0

Well, in that case select element by it's class name

if you just using javascript then should work,

var cbArray = document.getElementsByClassName('shoulduselikescheckbox');
var cb= cbArray [0];
gunvant.k
  • 1,096
  • 1
  • 10
  • 15