Questions tagged [pure-js]

PURE is a simple and ultra-fast templating tool for generating HTML from an HTML template and JSON data. DO NOT USE this tag if you want to indicate NO LIBRARIES are used.

PURE (Pure Unobtrusive Rendering Engine) is a simple and ultra-fast templating tool for generating HTML from an HTML template and JSON data.

PURE can work as a standalone library or with dojo, DOMAssistant, jQuery, Mootools, prototype.js, Sizzle and Sly.

Key features:

  • Build your templates with HTML, CSS and JavaScript only.
  • Ultra-fast, templates are compiled from HTML to Javascript for blazing rendering speed.
  • Unobtrusive, the HTML remains absolutely untouched.
  • Runs on the browser side.
  • Open Source, and released under the MIT License
49 questions
0
votes
0 answers

Get an element that was appended to the DOM dynamically using PURE JS

Basically what the question says. I import HTML code from an external file and append it to my main html code: /** * Get the HTML contents from the URL specified in the filename and add them * to the before the bottom of the specified DOM…
Nikitas IO
  • 696
  • 5
  • 20
0
votes
1 answer

execute a function after 2 other functions returns a desired response vanilla js

I have a project which contains a form of two cells one is a text and another is a date. I have 2 JS files that validate each cell I want if the text field and date field have a correct inputs to execute the new function. and if not show alert…
0
votes
0 answers

How to affect multiple HTML elements in one command written in Pure JavaScript?

I can add a CSS class to each element by iterating them, but is it possible to add the class to all of them at the same time? Example: Suppose I have 3 elements, when I add the class to 1st element the change would reflect the 1st element only and…
RGog
  • 96
  • 12
0
votes
2 answers

Convert javascript alertbox to show it on a html textbox

I want to show my xy coordinates in html td cell using JavaScript but instead of showing an alert, I want it to be shown in an html textbox var table = document.getElementsByTagName("table")[0]; var cells = table.getElementsByTagName("td"); //…
0
votes
2 answers

Delete item of html table coming from input in JS DOM

I have problem with deleting operation in html table in JS. I trying to delete item of table which coming from input.It is nothing happen. const name = document.querySelector(".name"); const surname = document.querySelector(".surname"); const…
Roop
  • 15
  • 6
0
votes
1 answer

How to add form input text into javascript array in specific way?

I have questions array in which I want to add HTML form data when I hit the submit button in the format as shown below: var questions = [ new Question("What language are we learning today?", ["Java", "C#","C++", "JavaScript"], "JavaScript"), …
David
  • 81
  • 10
0
votes
0 answers

function for all span elements - changing color on clicks

I have a problem, I want to make clickable boxes (span class="label") like this: first click = changing background to red, second click = background change to blue, third click = no color. However, counting a click is not on each box separately,…
Klaudia
  • 49
  • 6
0
votes
3 answers

How to push data to child array within nested array?

Attempting to build an array, which outputs data as following: Healthcare -- Data-driven insights to improve healthcare -- Urban Analytics Transport -- Urban Analytics Cities -- Urban Analytics I've tried looping 'expertise'/'text' but I'm unable…
Adam W.
  • 33
  • 5
0
votes
1 answer

I need an idea of creating methods that take elements before it

I need an idea of creating methods that take elements before it note it should take a defined element instead of an object example: "use strict"; var element = document.getElementById('name').value; elment.capitalize();//the capitaze should be a…
0
votes
1 answer

How can I create a custom event for scroll up and down?

The MDN told me how to create a custom event (which I didn't get it well) var event = new Event('build'); // Listen for the event. elem.addEventListener('build', function (e) { ... }, false); // Dispatch the event. elem.dispatchEvent(event); and…
George Carlin
  • 447
  • 5
  • 22
0
votes
0 answers

If else statement into a variable

I am trying to insert the statement If else with a for condition into a variable. I don't really know how to handle it. Here is my original function: var fontsList = '
' + Object.keys(families).map(function(familyName) { chaine…
Léo Durand
  • 215
  • 1
  • 4
  • 13
0
votes
1 answer

JQuery Pure Template

I cant figure out whats wrong. Its working when i tried to refresh only topics but it doesnt works when tried to refresh topics and page-links. ie. topics table's refreshing, and 'pagelinks' disappearing, i thought pure cannot reach - read second…
cem
  • 1,911
  • 12
  • 16
0
votes
1 answer

Create dynamic id using purejs

Using purejs, i want to create dynamic id to each rendering element. In this code i need to set id for each a tag. This 'a' tag will create depends on the jsonData.
Hello
vinothvetrivel
  • 109
  • 3
  • 10
-1
votes
1 answer

How to read width of css element with javascript?

So I want this VarDisk2 element to disappear after VarDisk1 width reaches more than 70. How can I do this?