Buscar un código de JavaScript

Mostrando del 1 al 10 de 14 coincidencias
<<>>
Se ha buscado por la cadena: print
Imágen de perfil
Val: 2.288
Plata
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

Obtener el valor de cualquier estilo de un elemento


JavaScript

Publicado el 19 de Marzo del 2021 por Katas (200 códigos)
686 visualizaciones desde el 19 de Marzo del 2021
Este código muestra como obtener cualquier valor de los posibles estilos que puede tener un elemento.

En este ejemplo, estos son los estilos de nuestro <div>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
-webkit-writing-mode -> horizontal-tb
-webkit-user-modify -> read-only
-webkit-user-drag -> auto
-webkit-text-stroke-width -> 0px
-webkit-text-stroke-color -> rgb(0, 0, 0)
-webkit-text-security -> none
-webkit-text-orientation -> vertical-right
-webkit-text-fill-color -> rgb(0, 0, 0)
-webkit-text-emphasis-style -> none
-webkit-text-emphasis-position -> over right
-webkit-text-emphasis-color -> rgb(0, 0, 0)
-webkit-text-decorations-in-effect -> none
-webkit-text-combine -> none
-webkit-tap-highlight-color -> rgba(0, 0, 0, 0.18)
-webkit-rtl-ordering -> logical
-webkit-print-color-adjust -> economy
-webkit-mask-size -> auto
-webkit-mask-repeat -> repeat
-webkit-mask-position -> 0% 0%
-webkit-mask-origin -> border-box
-webkit-mask-image -> none
-webkit-mask-composite -> source-over
-webkit-mask-clip -> border-box
-webkit-mask-box-image-width -> auto
-webkit-mask-box-image-source -> none
-webkit-mask-box-image-slice -> 0 fill
-webkit-mask-box-image-repeat -> stretch
-webkit-mask-box-image-outset -> 0
-webkit-mask-box-image -> none
-webkit-locale -> auto
-webkit-line-clamp -> none
-webkit-line-break -> auto
-webkit-hyphenate-character -> auto
-webkit-highlight -> none
-webkit-font-smoothing -> auto
-webkit-box-reflect -> none
-webkit-box-pack -> start
-webkit-box-orient -> horizontal
-webkit-box-ordinal-group -> 1
-webkit-box-flex -> 0
-webkit-box-direction -> normal
-webkit-box-decoration-break -> slice
-webkit-box-align -> stretch
-webkit-border-vertical-spacing -> 0px
-webkit-border-image -> none
-webkit-border-horizontal-spacing -> 0px
-webkit-app-region -> none
zoom -> 1
z-index -> auto
y -> 0px
x -> 0px
writing-mode -> horizontal-tb
word-spacing -> 0px
word-break -> normal
will-change -> auto
width -> 1247px
widows -> 2
white-space -> normal
visibility -> visible
vertical-align -> baseline
vector-effect -> none
user-select -> auto
unicode-bidi -> normal
transition-timing-function -> ease
transition-property -> all
transition-duration -> 0s
transition-delay -> 0s
transform-style -> flat
transform-origin -> 623.5px 612px
transform -> none
touch-action -> auto
top -> auto
text-underline-position -> auto
text-transform -> none
text-size-adjust -> auto
text-shadow -> none
text-rendering -> auto
text-overflow -> clip
text-indent -> 0px
text-decoration-style -> solid
text-decoration-skip-ink -> auto
text-decoration-line -> none
text-decoration-color -> rgb(0, 0, 0)
text-decoration -> none solid rgb(0, 0, 0)
text-anchor -> start
text-align-last -> auto
text-align -> start
table-layout -> auto
tab-size -> 8
stroke-width -> 1px
stroke-opacity -> 1
stroke-miterlimit -> 4
stroke-linejoin -> miter
stroke-linecap -> butt
stroke-dashoffset -> 0px
stroke-dasharray -> none
stroke -> none
stop-opacity -> 1
stop-color -> rgb(0, 0, 0)
speak -> normal
shape-rendering -> auto
shape-outside -> none
shape-margin -> 0px
shape-image-threshold -> 0
scroll-padding-inline-start -> auto
scroll-padding-inline-end -> auto
scroll-padding-block-start -> auto
scroll-padding-block-end -> auto
scroll-margin-inline-start -> 0px
scroll-margin-inline-end -> 0px
scroll-margin-block-start -> 0px
scroll-margin-block-end -> 0px
scroll-behavior -> auto
ry -> auto
rx -> auto
ruby-position -> over
row-gap -> normal
right -> auto
resize -> none
r -> 0px
position -> static
pointer-events -> auto
perspective-origin -> 623.5px 1098px
perspective -> none
paint-order -> normal
padding-top -> 0px
padding-right -> 0px
padding-left -> 0px
padding-inline-start -> 0px
padding-inline-end -> 0px
padding-bottom -> 0px
padding-block-start -> 0px
padding-block-end -> 0px
overscroll-behavior-inline -> auto
overscroll-behavior-block -> auto
overflow-y -> visible
overflow-x -> visible
overflow-wrap -> normal
overflow-anchor -> auto
outline-width -> 0px
outline-style -> none
outline-offset -> 0px
outline-color -> rgb(0, 0, 0)
orphans -> 2
order -> 0
opacity -> 1
offset-rotate -> auto 0deg
offset-path -> none
offset-distance -> 0px
object-position -> 50% 50%
object-fit -> fill
mix-blend-mode -> normal
min-width -> 0px
min-inline-size -> 0px
min-height -> 0px
min-block-size -> 0px
max-width -> none
max-inline-size -> none
max-height -> none
max-block-size -> none
mask-type -> luminance
marker-start -> none
marker-mid -> none
marker-end -> none
margin-top -> 0px
margin-right -> 0px
margin-left -> 0px
margin-inline-start -> 0px
margin-inline-end -> 0px
margin-bottom -> 0px
margin-block-start -> 0px
margin-block-end -> 0px
list-style-type -> disc
list-style-position -> outside
list-style-image -> none
line-height -> normal
line-break -> auto
lighting-color -> rgb(255, 255, 255)
letter-spacing -> normal
left -> auto
justify-self -> auto
justify-items -> normal
justify-content -> normal
isolation -> auto
inset-inline-start -> auto
inset-inline-end -> auto
inset-block-start -> auto
inset-block-end -> auto
inline-size -> 1247px
image-rendering -> auto
image-orientation -> from-image
hyphens -> manual
height -> 3456px
grid-template-rows -> none
grid-template-columns -> none
grid-template-areas -> none
grid-row-start -> auto
grid-row-end -> auto
grid-column-start -> auto
grid-column-end -> auto
grid-auto-rows -> auto
grid-auto-flow -> row
grid-auto-columns -> auto
font-weight -> 400
font-variant-numeric -> normal
font-variant-ligatures -> normal
font-variant-east-asian -> normal
font-variant-caps -> normal
font-variant -> normal
font-style -> normal
font-stretch -> 100%
font-size -> 16px
font-optical-sizing -> auto
font-kerning -> auto
font-family -> "Times New Roman"
flood-opacity -> 1
flood-color -> rgb(0, 0, 0)
float -> none
flex-wrap -> nowrap
flex-shrink -> 1
flex-grow -> 0
flex-direction -> row
flex-basis -> auto
filter -> none
fill-rule -> nonzero
fill-opacity -> 1
fill -> rgb(0, 0, 0)
empty-cells -> show
dominant-baseline -> auto
display -> block
direction -> ltr
d -> none
cy -> 0px
cx -> 0px
cursor -> auto
content -> normal
column-width -> auto
column-span -> none
column-rule-width -> 0px
column-rule-style -> none
column-rule-color -> rgb(0, 0, 0)
column-gap -> normal
column-count -> auto
color-rendering -> auto
color-interpolation-filters -> linearrgb
color-interpolation -> srgb
color -> rgb(0, 0, 0)
clip-rule -> nonzero
clip-path -> none
clip -> auto
clear -> none
caret-color -> rgb(0, 0, 0)
caption-side -> top
buffered-rendering -> auto
break-inside -> auto
break-before -> auto
break-after -> auto
box-sizing -> content-box
box-shadow -> none
bottom -> auto
border-top-width -> 0px
border-top-style -> none
border-top-right-radius -> 0px
border-top-left-radius -> 0px
border-top-color -> rgb(0, 0, 0)
border-right-width -> 0px
border-right-style -> none
border-right-color -> rgb(0, 0, 0)
border-left-width -> 0px
border-left-style -> none
border-left-color -> rgb(0, 0, 0)
border-inline-start-width -> 0px
border-inline-start-style -> none
border-inline-start-color -> rgb(0, 0, 0)
border-inline-end-width -> 0px
border-inline-end-style -> none
border-inline-end-color -> rgb(0, 0, 0)
border-image-width -> 1
border-image-source -> none
border-image-slice -> 100%
border-image-repeat -> stretch
border-image-outset -> 0
border-collapse -> separate
border-bottom-width -> 0px
border-bottom-style -> none
border-bottom-right-radius -> 0px
border-bottom-left-radius -> 0px
border-bottom-color -> rgb(0, 0, 0)
border-block-start-width -> 0px
border-block-start-style -> none
border-block-start-color -> rgb(0, 0, 0)
border-block-end-width -> 0px
border-block-end-style -> none
border-block-end-color -> rgb(0, 0, 0)
block-size -> 5292px
baseline-shift -> 0px
background-size -> auto
background-repeat -> repeat
background-position -> 0% 0%
background-origin -> padding-box
background-image -> url("http://localhost/test/image.jpg")
background-color -> rgba(0, 0, 0, 0)
background-clip -> border-box
background-blend-mode -> normal
background-attachment -> scroll
backface-visibility -> visible
backdrop-filter -> none
appearance -> none
animation-timing-function -> ease
animation-play-state -> running
animation-name -> none
animation-iteration-count -> 1
animation-fill-mode -> none
animation-duration -> 0s
animation-direction -> normal
animation-delay -> 0s
alignment-baseline -> auto
align-self -> auto
align-items -> normal
align-content -> normal
Imágen de perfil
Val: 2.288
Plata
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

Obtener la cantidad de veces que cada vocal aparece en una cadena


JavaScript

Publicado el 15 de Enero del 2020 por Katas (200 códigos)
1.848 visualizaciones desde el 15 de Enero del 2020
Crear una función que reciba una cadena y devuelva un objeto con la la cantidad de veces que aparece cada vocal en la cadena.

1
2
3
4
5
console.log(getVowels("")); // {a: 0, e: 0, i: 0, o: 0, u: 0}
console.log(getVowels("zzzz")); // {a: 0, e: 0, i: 0, o: 0, u: 0}
console.log(getVowels("the bIg house")); // {a: 0, e: 2, i: 1, o: 1, u: 1}
const str="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
console.log(getVowels(str)); // {a: 29, e: 59, i: 38, o: 25, u: 17}
Imágen de perfil
Val: 1.807
Plata
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

Imprimir el contenido de un iframe


JavaScript

Publicado el 28 de Agosto del 2011 por Xavi (548 códigos)
10.639 visualizaciones desde el 28 de Agosto del 2011
Código que muestra como imprimir el contenido de un iframe utilizando la instrucción focus() y print(). La pagina a imprimir, tienes que estar en el mismo puerto y dominio.
Imágen de perfil
Val: 64
Ha aumentado 1 puesto en JavaScript (en relación al último mes)
Gráfica de JavaScript

formatear un numero según es introducido en un input de un formulario


JavaScript

Publicado el 28 de Enero del 2021 por Aitor (6 códigos)
3.015 visualizaciones desde el 28 de Enero del 2021
Rutina en JavaScript para formatear el campo input de un formulario según se va introduciendo con el teclado.

Hay varias clases:
Números enteros positivos y negativos o solo los positivos.
Números flotantes positivos y negativos o solo los positivos.
Fijación de números flotantes a 2 decimales.

Se puede indicar el formato de los separadores de miles y de decimales entre el formato USA que usa como separador de miles la coma "," y el separador de decimales el punto "." o viceversa como en España.

Demo y copia gratuita de:
https://www.bc3toexcel.com/compartir/input-format-number-as-keyed.htm

En el navegador pulsando botón derecho del ratón opción mostrar código fuente se puede copiar.
format-number-as-keyed
sin imagen de perfil
Val: 28
Ha aumentado su posición en 2 puestos en JavaScript (en relación al último mes)
Gráfica de JavaScript

Proporción de números


JavaScript

Publicado el 18 de Enero del 2021 por Ludovico (5 códigos)
499 visualizaciones desde el 18 de Enero del 2021
Quizás esto pueda ser útil para algunas personas...

La proporción de números en el vector que son mayores, menores o iguales a 0.

1
2
3
GREATER_THAN_0 = 0.625
LESS_THAN_0 = 0.25
EQUAL_TO_0 = 0.125
Imágen de perfil
Val: 2.288
Plata
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

Eliminar cualquier caracter no ASCII de una cadena


JavaScript

Publicado el 4 de Abril del 2020 por Katas (200 códigos)
840 visualizaciones desde el 4 de Abril del 2020
Este código muestra como eliminar con una expresión regular cualquier carácter no ASCII de una cadena.
Eliminar cualquier carácter de una cadena que no este entre el valore hex 0x20 y el x07E.

1
removeNonASCII("áéíóúàThe big houseèìòùäëïöü"); // "The big house"
Anterior12Siguiente