mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[js] title setter
This commit is contained in:
parent
4270cb3125
commit
040ab5a189
@ -1632,6 +1632,14 @@ element_set_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xmlpp::Element *el = JS_GetPrivate(hobj);
|
||||||
|
if (!el) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string value = JS_EncodeString(ctx, args[0].toString());
|
||||||
|
el->set_attribute("title", value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,17 @@
|
|||||||
<script>
|
<script>
|
||||||
function aa()
|
function aa()
|
||||||
{
|
{
|
||||||
// alert(document.getElementById('blabla').title);
|
|
||||||
alert(document.getElementById('ble').title);
|
alert(document.getElementById('ble').title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bb()
|
||||||
|
{
|
||||||
|
document.getElementById('ble').title = 'BLEBLE';
|
||||||
|
aa();
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<button onclick="return aa()">Click me!</button>
|
<button onclick="return aa()">Click me!</button>
|
||||||
|
<button onclick="return bb()">Change title of element</button>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user