This is the part of page source of a website. I need to grab the " crsEdId=78 " in the last line. Using JavaScript or JQuery.
I will use mozilla Jetpack to do the task.
How can i Get this Code first? and What to do (RegEx or JQuery) on it !?
<div class="tools-menu-body" id="tools-menu-div" style="display: none;">
<div id="menu_glider">
<div class="scroller">
<div class="content">
<div class="section" id="courses_menu">
<ul class="tools-menu-ul">
<li class="tools-menu-back"><a href="#main_menu" class="controls">back</a></li>
<li><a title="Advanced Software Engineering Lab: Open Source Development" href="../Courses/CourseEdition.aspx?crsEdId=78">CSEN 914 </a></li>
IT WORKED :
well it was a stupid thing - i just had to put the selector inside the click function, donno why i didn't think about it earlier.
jetpack.statusBar.append({
html: "Boom<i>!</i>",
width: 45,
onReady: function(widget){
$(widget).click(function(){
var doc= jetpack.tabs.focused.contentDocument;
var link= doc.querySelector('#courses_menu > ul > li:nth-child(2) a');
var test= doc.getElementById('#container');
jetpack.notifications.show("Course is is = "+ link);
});
}
});
Now i need to get all the href inside this courses_menu !! Can you help in that ?