I have multiple divs with ids like course1_popup
, course2_popup
, course3_popup
. I want to make a function something like
$('#course*_popup').hide();
so that all course*_popup
divs should hide but this is not working. Any Ideas?
答案 0 :(得分:12)
使用属性starts with和ends with选择器的组合。
define(function (require, exports, module) {
"use strict";
// Brackets modules
var ProjectManager = require("project/ProjectManager"),
ExtensionUtils = require('utils/ExtensionUtils'),
FileSystem = brackets.getModule("filesystem/FileSystem"),
//AppInit = brackets.getModule("utils/AppInit"),
shellProvider = brackets.getModule('shellAPI/shellProvider');
var fs=require("fs");
仅供参考:为这类事物使用一组公共类会更好。
答案 1 :(得分:4)
最简单的方法:像 course_popup 一样提供所有相同的类,然后:
$('.course_popup').hide()
其他解决方案是在一秒前发布的;)