Tag html

[Solved] How can I get the values of data attributes in JavaScript code?

You need to access the dataset property: document.getElementById(“the-span”).addEventListener(“click”, function() { var json = JSON.stringify({ id: parseInt(this.dataset.typeid), subject: this.dataset.type, points: parseInt(this.dataset.points), user: “Luïs” }); }); Result: // json would equal: { “id”: 123, “subject”: “topic”, “points”: -1, “user”: “Luïs” } 2…

[Solved] c# Regex catch string between two string [duplicate]

You can try this:<[a-z\s]+id=[\’\”]mobile[\w]+[\’\”][\sa-zA-Z\d\’\=\;\:]*>([a-zA-Z\d\s]+)<[\/a-z\s]+> Anyway it will not match special chars or symbols. You can test and optimize it here: EDIT – Code example This could be the portion of code to extract the messages: var rgx = @”<[a-z\s]+id=[\’]mobile[\w]+[\’][\sa-zA-Z\d\s\’\=\;\:]*>([a-zA-Z\d\s]+)<[\/a-z\s]+>”;…

[Solved] Creating HTML table with php output

Your issues lies in your formatting and confusion between the use of the echo command and non PHP wrapped HTML. Code should read as follows when properly formatted. <?php $db_host = “localhost”; $db_username = “vistor”; $db_pass = “visitor”; $db_name =…

[Solved] Complete change and adding of content in webpage [closed]

Assuming you have something like this: <div id=”somecontent”><video …><p>Video Caption</p></div> You can use simple DOM scripting to select the element and replace its contents: <script> var element = document.getElementById(“somecontent”); element.innerHTML = “<audio><p>New Caption</p>” </script> You would then tie this replacement…

[Solved] Change a html link destination on date in the future

<script type=”text/javascript”> function callFunc() { var compareDate = new Date(2013, 0, 31, 0, 0, 0, 0); alert(“compareDate: ” + compareDate.toString()); var curDate = new Date(); if (curDate.getTime() > compareDate.getTime()) { return “”; } else { return “”; } } document.write(‘<a…