DOM Elements Creator

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-14 22:57:24

软件介绍

What is it?

DOM Elements Creator is a simple plugin for creating DOM elements on-a-fly which can be used as part of jQuery statements.

When you want to create new DOM element in pure jQuery you must use document.createElement() method and then new element must be wrapped in $() before it can be used in jQuery context. You can also use HTML code as a selector to create a new object but this way requires writing HTML, which is rarely comfortable. And you must also remember to espace any quotes.
This plugin provides more elegant way to achieve the same effect and requires writting less code.

How to use it?

Just import plugin file after importing the jQuery library and you're set.

Syntax:

$.create(element[, attributes[, children]])

Parameters:

  • string element - name of the element to create
  • object|array attributes - element properties to be set, you shouln't use events attributes here such as onclick, onmouseover etc. since they won't work
  • string|array children - child elements (could also contain text value)

Example:

  • JavaScript/jQuery approach:
    var div = document.createElement('div');
    $(div).attr('id', 'myId').text('myText').appendTo('#myElem');
  • standard jQuery approach:
    $('<div>').attr('id', 'myId').text('myText').appendTo('#myElem');
    or
    $('<div id="myId">myText</div>').appendTo('#myElem');
  • plugin approach:
    $.create('div', {'id': 'myId'}, 'myText').appendTo('#myElem');

Incompatible changes

0.3

Plugin function was renamed from $.new to $.create to fix issues on Internet Explorer.

本文地址:https://codercto.com/soft/d/23400.html

深度学习

深度学习

[美]特伦斯·谢诺夫斯基(Terrence Sejnowski) / 姜悦兵 / 中信出版集团 / 2019-2 / 88

全球科技巨头纷纷拥抱深度学习,自动驾驶、AI医疗、语音识别、图像识别、智能翻译以及震惊世界的AlphaGo,背后都是深度学习在发挥神奇的作用。深度学习是人工智能从概念到繁荣得以实现的主流技术。经过深度学习训练的计算机,不再被动按照指令运转,而是像自然进化的生命那样,开始自主地从经验中学习。 本书作者特伦斯·谢诺夫斯基是全球人工智能十大科学家之一、深度学习先驱及奠基者,亲历了深度学习在20世纪......一起来看看 《深度学习》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具